<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Log::Log4perl - Log4j implementation for Perl - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of Log-Log4perl - MetaCPAN" href="https://metacpan.org/dist/Log-Log4perl/releases.rss" />
        <link rel="canonical" href="./Log::Log4perl.html" />
        <meta name="description" content="Log4j implementation for Perl" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/Log::Log4perl" />
<meta name="twitter:title"       content="Log::Log4perl" />
<meta name="twitter:description" content="Log4j implementation for Perl" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./Log::Log4perl.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of Log-Log4perl was released.">
      <span class="relatize">21 Oct 2022 16:47:36 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/Log-Log4perl">Log-Log4perl</a>
  </li>
  <li>
    Module version: 1.57
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/Log-Log4perl/source/lib/Log/Log4perl.pm">Source</a>
    (<a href="https://metacpan.org/dist/Log-Log4perl/source/lib/Log/Log4perl.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/Log-Log4perl/source/lib/Log">Browse</a>
    (<a href="https://metacpan.org/dist/Log-Log4perl/source/lib/Log?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/Log-Log4perl/changes">Changes</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/Log-Log4perl/contribute">How to Contribute</a>
    </li>
    <li>
        <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/mschilli/log4perl">Repository</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://github.com/mschilli/log4perl/issues">Issues</a>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=Log-Log4perl+1.57" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/L/Log-Log4perl.html?oncpan=1&amp;distmat=1&amp;version=1.57&amp;grade=2" style="color: #090">3249</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/L/Log-Log4perl.html?oncpan=1&amp;distmat=1&amp;version=1.57&amp;grade=3" style="color: #900">1</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/L/Log-Log4perl.html?oncpan=1&amp;distmat=1&amp;version=1.57&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/ETJ/Log-Log4perl-1.57">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on Log-Log4perl who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 1
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/Log-Log4perl-1.57/index.html">81.33% Coverage </a>
    </li>
    <li>
      License: perl_5
    </li>
    <li>
      Perl: v5.6.0
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/Log-Log4perl/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/E/ET/ETJ/Log-Log4perl-1.57.tar.gz">
      Download (<span itemprop="fileSize">273.51KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FETJ%2FLog-Log4perl-1.57%2Flib%2FLog%2FLog4perl.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Log-Log4perl/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Log-Log4perl/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:Log-Log4perl">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="Log-Log4perl">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Log/Log4perl.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="ETJ/Log-Log4perl-1.57"
>1.57
  (ETJ on 2022-10-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.49"
>1.49
  (MSCHILLI on 2017-02-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.48"
>1.48
  (MSCHILLI on 2016-11-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.47"
>1.47
  (MSCHILLI on 2016-03-18)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.46"
>1.46
  (MSCHILLI on 2014-11-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.45"
>1.45
  (MSCHILLI on 2014-10-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.44"
>1.44
  (MSCHILLI on 2014-05-18)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.43"
>1.43
  (MSCHILLI on 2014-03-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.42"
>1.42
  (MSCHILLI on 2013-07-26)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.41"
>1.41
  (MSCHILLI on 2013-04-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.40"
>1.40
  (MSCHILLI on 2012-12-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.39"
>1.39
  (MSCHILLI on 2012-10-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.38"
>1.38
  (MSCHILLI on 2012-09-23)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.37"
>1.37
  (MSCHILLI on 2012-05-31)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.36"
>1.36
  (MSCHILLI on 2012-02-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.35"
>1.35
  (MSCHILLI on 2012-01-03)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.34"
>1.34
  (MSCHILLI on 2011-11-05)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.33"
>1.33
  (MSCHILLI on 2011-06-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.32"
>1.32
  (MSCHILLI on 2011-02-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.31"
>1.31
  (MSCHILLI on 2010-10-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.30"
>1.30
  (MSCHILLI on 2010-08-31)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.29"
>1.29
  (MSCHILLI on 2010-06-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.28"
>1.28
  (MSCHILLI on 2010-02-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.27"
>1.27
  (MSCHILLI on 2010-02-07)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.26"
>1.26
  (MSCHILLI on 2009-11-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.25"
>1.25
  (MSCHILLI on 2009-09-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.24"
>1.24
  (MSCHILLI on 2009-07-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.23"
>1.23
  (MSCHILLI on 2009-05-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.22"
>1.22
  (MSCHILLI on 2009-05-03)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.21"
>1.21
  (MSCHILLI on 2009-03-26)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.20"
>1.20
  (MSCHILLI on 2008-12-11)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.00"
>1.00
  (MSCHILLI on 2005-08-18)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.47"
>0.47
  (MSCHILLI on 2004-07-14)</option>
<option
  
  value="KGOESS/Log-Log4perl-0.25"
>0.25
  (KGOESS on 2002-10-07)</option>
<optgroup label="BackPAN">'
<option
  
  value="ETJ/Log-Log4perl-1.56"
>1.56
  (ETJ on 2022-09-02)</option>
<option
  
  value="ETJ/Log-Log4perl-1.55"
>1.55
  (ETJ on 2022-06-01)</option>
<option
  
  value="ETJ/Log-Log4perl-1.54"
>1.54
  (ETJ on 2021-02-06)</option>
<option
  
  value="ETJ/Log-Log4perl-1.53"
>1.53
  (ETJ on 2020-09-17)</option>
<option
  
  value="ETJ/Log-Log4perl-1.52"
>1.52
  (ETJ on 2020-09-07)</option>
<option
  
  value="ETJ/Log-Log4perl-1.51"
>1.51
  (ETJ on 2020-09-05)</option>
<option
  
  value="ETJ/Log-Log4perl-1.50"
>1.50
  (ETJ on 2020-07-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.19"
>1.19
  (MSCHILLI on 2008-10-29)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.18"
>1.18
  (MSCHILLI on 2008-08-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.17"
>1.17
  (MSCHILLI on 2008-07-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.16"
>1.16
  (MSCHILLI on 2008-05-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.15"
>1.15
  (MSCHILLI on 2008-02-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.14"
>1.14
  (MSCHILLI on 2007-11-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.13"
>1.13
  (MSCHILLI on 2007-10-14)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.12"
>1.12
  (MSCHILLI on 2007-06-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.11"
>1.11
  (MSCHILLI on 2007-06-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.10"
>1.10
  (MSCHILLI on 2007-04-04)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.09"
>1.09
  (MSCHILLI on 2007-02-10)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.08"
>1.08
  (MSCHILLI on 2006-11-25)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.07"
>1.07
  (MSCHILLI on 2006-10-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.06"
>1.06
  (MSCHILLI on 2006-07-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.05"
>1.05
  (MSCHILLI on 2006-06-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.04"
>1.04
  (MSCHILLI on 2006-03-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.03"
>1.03
  (MSCHILLI on 2006-02-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.02"
>1.02
  (MSCHILLI on 2005-12-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.01"
>1.01
  (MSCHILLI on 2005-10-02)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.52"
>0.52
  (MSCHILLI on 2005-05-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.51"
>0.51
  (MSCHILLI on 2005-01-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.50"
>0.50
  (MSCHILLI on 2004-12-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.49"
>0.49
  (MSCHILLI on 2004-11-10)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.48"
>0.48
  (MSCHILLI on 2004-08-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.46"
>0.46
  (MSCHILLI on 2004-06-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.45"
>0.45
  (MSCHILLI on 2004-05-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.44"
>0.44
  (MSCHILLI on 2004-05-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.43"
>0.43
  (MSCHILLI on 2004-03-25)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.42"
>0.42
  (MSCHILLI on 2004-02-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.41"
>0.41
  (MSCHILLI on 2003-12-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.40"
>0.40
  (MSCHILLI on 2003-11-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.39"
>0.39
  (MSCHILLI on 2003-10-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.38"
>0.38
  (MSCHILLI on 2003-10-05)</option>
<option
  
  value="PNE/Log-Log4perl-0.37"
>0.37
  (PNE on 2003-09-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.37"
>0.37
  (MSCHILLI on 2003-09-19)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.36"
>0.36
  (MSCHILLI on 2003-07-29)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.35"
>0.35
  (MSCHILLI on 2003-07-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.34"
>0.34
  (MSCHILLI on 2003-06-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.33"
>0.33
  (MSCHILLI on 2003-06-03)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.32"
>0.32
  (MSCHILLI on 2003-05-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.31"
>0.31
  (MSCHILLI on 2003-05-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.30"
>0.30
  (MSCHILLI on 2003-03-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.29"
>0.29
  (MSCHILLI on 2003-02-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.28"
>0.28
  (MSCHILLI on 2003-01-30)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.27"
>0.27
  (MSCHILLI on 2002-12-07)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.26"
>0.26
  (MSCHILLI on 2002-11-12)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.24"
>0.24
  (MSCHILLI on 2002-09-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.23"
>0.23
  (MSCHILLI on 2002-09-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.22"
>0.22
  (MSCHILLI on 2002-08-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.21"
>0.21
  (MSCHILLI on 2002-08-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.20"
>0.20
  (MSCHILLI on 2002-07-23)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.19"
>0.19
  (MSCHILLI on 2002-07-16)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.18"
>0.18
  (MSCHILLI on 2002-07-16)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.17"
>0.17
  (MSCHILLI on 2002-07-16)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.16"
>0.16
  (MSCHILLI on 2002-07-11)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/ETJ/Log-Log4perl-1.57/diff/' + encodeURIComponent(this.value) + '/lib/Log/Log4perl.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="ETJ/Log-Log4perl-1.57"
>1.57
  (ETJ on 2022-10-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.49"
>1.49
  (MSCHILLI on 2017-02-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.48"
>1.48
  (MSCHILLI on 2016-11-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.47"
>1.47
  (MSCHILLI on 2016-03-18)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.46"
>1.46
  (MSCHILLI on 2014-11-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.45"
>1.45
  (MSCHILLI on 2014-10-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.44"
>1.44
  (MSCHILLI on 2014-05-18)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.43"
>1.43
  (MSCHILLI on 2014-03-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.42"
>1.42
  (MSCHILLI on 2013-07-26)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.41"
>1.41
  (MSCHILLI on 2013-04-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.40"
>1.40
  (MSCHILLI on 2012-12-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.39"
>1.39
  (MSCHILLI on 2012-10-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.38"
>1.38
  (MSCHILLI on 2012-09-23)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.37"
>1.37
  (MSCHILLI on 2012-05-31)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.36"
>1.36
  (MSCHILLI on 2012-02-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.35"
>1.35
  (MSCHILLI on 2012-01-03)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.34"
>1.34
  (MSCHILLI on 2011-11-05)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.33"
>1.33
  (MSCHILLI on 2011-06-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.32"
>1.32
  (MSCHILLI on 2011-02-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.31"
>1.31
  (MSCHILLI on 2010-10-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.30"
>1.30
  (MSCHILLI on 2010-08-31)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.29"
>1.29
  (MSCHILLI on 2010-06-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.28"
>1.28
  (MSCHILLI on 2010-02-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.27"
>1.27
  (MSCHILLI on 2010-02-07)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.26"
>1.26
  (MSCHILLI on 2009-11-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.25"
>1.25
  (MSCHILLI on 2009-09-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.24"
>1.24
  (MSCHILLI on 2009-07-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.23"
>1.23
  (MSCHILLI on 2009-05-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.22"
>1.22
  (MSCHILLI on 2009-05-03)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.21"
>1.21
  (MSCHILLI on 2009-03-26)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.20"
>1.20
  (MSCHILLI on 2008-12-11)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.00"
>1.00
  (MSCHILLI on 2005-08-18)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.47"
>0.47
  (MSCHILLI on 2004-07-14)</option>
<option
  
  value="KGOESS/Log-Log4perl-0.25"
>0.25
  (KGOESS on 2002-10-07)</option>
<optgroup label="BackPAN">'
<option
  
  value="ETJ/Log-Log4perl-1.56"
>1.56
  (ETJ on 2022-09-02)</option>
<option
  
  value="ETJ/Log-Log4perl-1.55"
>1.55
  (ETJ on 2022-06-01)</option>
<option
  
  value="ETJ/Log-Log4perl-1.54"
>1.54
  (ETJ on 2021-02-06)</option>
<option
  
  value="ETJ/Log-Log4perl-1.53"
>1.53
  (ETJ on 2020-09-17)</option>
<option
  
  value="ETJ/Log-Log4perl-1.52"
>1.52
  (ETJ on 2020-09-07)</option>
<option
  
  value="ETJ/Log-Log4perl-1.51"
>1.51
  (ETJ on 2020-09-05)</option>
<option
  
  value="ETJ/Log-Log4perl-1.50"
>1.50
  (ETJ on 2020-07-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.19"
>1.19
  (MSCHILLI on 2008-10-29)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.18"
>1.18
  (MSCHILLI on 2008-08-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.17"
>1.17
  (MSCHILLI on 2008-07-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.16"
>1.16
  (MSCHILLI on 2008-05-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.15"
>1.15
  (MSCHILLI on 2008-02-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.14"
>1.14
  (MSCHILLI on 2007-11-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.13"
>1.13
  (MSCHILLI on 2007-10-14)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.12"
>1.12
  (MSCHILLI on 2007-06-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.11"
>1.11
  (MSCHILLI on 2007-06-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.10"
>1.10
  (MSCHILLI on 2007-04-04)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.09"
>1.09
  (MSCHILLI on 2007-02-10)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.08"
>1.08
  (MSCHILLI on 2006-11-25)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.07"
>1.07
  (MSCHILLI on 2006-10-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.06"
>1.06
  (MSCHILLI on 2006-07-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.05"
>1.05
  (MSCHILLI on 2006-06-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.04"
>1.04
  (MSCHILLI on 2006-03-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.03"
>1.03
  (MSCHILLI on 2006-02-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.02"
>1.02
  (MSCHILLI on 2005-12-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.01"
>1.01
  (MSCHILLI on 2005-10-02)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.52"
>0.52
  (MSCHILLI on 2005-05-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.51"
>0.51
  (MSCHILLI on 2005-01-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.50"
>0.50
  (MSCHILLI on 2004-12-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.49"
>0.49
  (MSCHILLI on 2004-11-10)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.48"
>0.48
  (MSCHILLI on 2004-08-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.46"
>0.46
  (MSCHILLI on 2004-06-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.45"
>0.45
  (MSCHILLI on 2004-05-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.44"
>0.44
  (MSCHILLI on 2004-05-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.43"
>0.43
  (MSCHILLI on 2004-03-25)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.42"
>0.42
  (MSCHILLI on 2004-02-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.41"
>0.41
  (MSCHILLI on 2003-12-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.40"
>0.40
  (MSCHILLI on 2003-11-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.39"
>0.39
  (MSCHILLI on 2003-10-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.38"
>0.38
  (MSCHILLI on 2003-10-05)</option>
<option
  
  value="PNE/Log-Log4perl-0.37"
>0.37
  (PNE on 2003-09-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.37"
>0.37
  (MSCHILLI on 2003-09-19)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.36"
>0.36
  (MSCHILLI on 2003-07-29)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.35"
>0.35
  (MSCHILLI on 2003-07-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.34"
>0.34
  (MSCHILLI on 2003-06-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.33"
>0.33
  (MSCHILLI on 2003-06-03)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.32"
>0.32
  (MSCHILLI on 2003-05-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.31"
>0.31
  (MSCHILLI on 2003-05-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.30"
>0.30
  (MSCHILLI on 2003-03-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.29"
>0.29
  (MSCHILLI on 2003-02-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.28"
>0.28
  (MSCHILLI on 2003-01-30)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.27"
>0.27
  (MSCHILLI on 2002-12-07)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.26"
>0.26
  (MSCHILLI on 2002-11-12)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.24"
>0.24
  (MSCHILLI on 2002-09-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.23"
>0.23
  (MSCHILLI on 2002-09-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.22"
>0.22
  (MSCHILLI on 2002-08-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.21"
>0.21
  (MSCHILLI on 2002-08-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.20"
>0.20
  (MSCHILLI on 2002-07-23)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.19"
>0.19
  (MSCHILLI on 2002-07-16)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.18"
>0.18
  (MSCHILLI on 2002-07-16)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.17"
>0.17
  (MSCHILLI on 2002-07-16)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.16"
>0.16
  (MSCHILLI on 2002-07-11)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/File::Path" title="File::Path" class="ellipsis">File::Path</a></li>
  <li><a href="https://metacpan.org/pod/File::Spec" title="File::Spec" class="ellipsis">File::Spec</a></li>
  <li><i class="ttip" title="dynamic_config enabled">and possibly others</i></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/Log::Log4perl/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=Log%3A%3ALog4perl">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=Log-Log4perl">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/ETJ/Log-Log4perl-1.57/view/lib/Log/Log4perl.pm">This version</a>
    </li>
    <li>
      <a href="./Log::Log4perl.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/RRWO"><img src="https://www.gravatar.com/avatar/4a5274bc5d690ee3d619f044778771a7?d=identicon&amp;s=20" title="RRWO" alt="RRWO"></a>
<a class="display-all" href="https://metacpan.org/author/LXP"><img src="https://www.gravatar.com/avatar/979801c4b879bd8f3f0f75cb93ad5be7?d=identicon&amp;s=20" title="LXP" alt="LXP"></a>
<a class="display-all" href="https://metacpan.org/author/SYP"><img src="https://www.gravatar.com/avatar/9b6fa62677be03c25ee1af4d95472042?d=identicon&amp;s=20" title="SYP" alt="SYP"></a>
<a class="display-all" href="https://metacpan.org/author/PINGAN"><img src="https://www.gravatar.com/avatar/a02222e5e0e4fd24d52fc29a08ac6bcb?d=identicon&amp;s=20" title="PINGAN" alt="PINGAN"></a>
<a class="display-all" href="https://metacpan.org/author/SZABGAB"><img src="https://www.gravatar.com/avatar/4e0a6fe2acda5df6095514e7d6329e91?d=identicon&amp;s=20" title="SZABGAB" alt="SZABGAB"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/Log-Log4perl/plussers">45 PAUSE users</a>
</div>
<div>
    62 non-PAUSE users
</div>
</div>
    </li>
    <li>
<div id="metacpan_contributors">
  <div>
    <button class="btn-link"
      onclick="$(this).hide(); $('#metacpan_contributors ul').slideDown(); return false;"
    >and 1 contributors</button>
  </div>
  <ul style="display: none">
    <li class="contributor"
      data-cpan-author="MSCHILLI"
      data-contrib-email="m@perlmeister.com"
    >
      <a href="https://metacpan.org/author/MSCHILLI" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/57604f4f5170e143dd45ec8c93608e63?d=identicon&amp;s=20" />
      Mike Schilli
      </a>
    </li>
  </ul>
</div>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/ETJ" class="author-name">Ed J</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Log/Log4perl.pm&#39;" class="">
<option
  selected
  value="ETJ/Log-Log4perl-1.57"
>1.57
  (ETJ on 2022-10-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.49"
>1.49
  (MSCHILLI on 2017-02-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.48"
>1.48
  (MSCHILLI on 2016-11-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.47"
>1.47
  (MSCHILLI on 2016-03-18)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.46"
>1.46
  (MSCHILLI on 2014-11-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.45"
>1.45
  (MSCHILLI on 2014-10-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.44"
>1.44
  (MSCHILLI on 2014-05-18)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.43"
>1.43
  (MSCHILLI on 2014-03-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.42"
>1.42
  (MSCHILLI on 2013-07-26)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.41"
>1.41
  (MSCHILLI on 2013-04-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.40"
>1.40
  (MSCHILLI on 2012-12-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.39"
>1.39
  (MSCHILLI on 2012-10-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.38"
>1.38
  (MSCHILLI on 2012-09-23)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.37"
>1.37
  (MSCHILLI on 2012-05-31)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.36"
>1.36
  (MSCHILLI on 2012-02-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.35"
>1.35
  (MSCHILLI on 2012-01-03)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.34"
>1.34
  (MSCHILLI on 2011-11-05)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.33"
>1.33
  (MSCHILLI on 2011-06-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.32"
>1.32
  (MSCHILLI on 2011-02-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.31"
>1.31
  (MSCHILLI on 2010-10-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.30"
>1.30
  (MSCHILLI on 2010-08-31)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.29"
>1.29
  (MSCHILLI on 2010-06-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.28"
>1.28
  (MSCHILLI on 2010-02-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.27"
>1.27
  (MSCHILLI on 2010-02-07)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.26"
>1.26
  (MSCHILLI on 2009-11-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.25"
>1.25
  (MSCHILLI on 2009-09-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.24"
>1.24
  (MSCHILLI on 2009-07-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.23"
>1.23
  (MSCHILLI on 2009-05-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.22"
>1.22
  (MSCHILLI on 2009-05-03)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.21"
>1.21
  (MSCHILLI on 2009-03-26)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.20"
>1.20
  (MSCHILLI on 2008-12-11)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.00"
>1.00
  (MSCHILLI on 2005-08-18)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.47"
>0.47
  (MSCHILLI on 2004-07-14)</option>
<option
  
  value="KGOESS/Log-Log4perl-0.25"
>0.25
  (KGOESS on 2002-10-07)</option>
<optgroup label="BackPAN">'
<option
  
  value="ETJ/Log-Log4perl-1.56"
>1.56
  (ETJ on 2022-09-02)</option>
<option
  
  value="ETJ/Log-Log4perl-1.55"
>1.55
  (ETJ on 2022-06-01)</option>
<option
  
  value="ETJ/Log-Log4perl-1.54"
>1.54
  (ETJ on 2021-02-06)</option>
<option
  
  value="ETJ/Log-Log4perl-1.53"
>1.53
  (ETJ on 2020-09-17)</option>
<option
  
  value="ETJ/Log-Log4perl-1.52"
>1.52
  (ETJ on 2020-09-07)</option>
<option
  
  value="ETJ/Log-Log4perl-1.51"
>1.51
  (ETJ on 2020-09-05)</option>
<option
  
  value="ETJ/Log-Log4perl-1.50"
>1.50
  (ETJ on 2020-07-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.19"
>1.19
  (MSCHILLI on 2008-10-29)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.18"
>1.18
  (MSCHILLI on 2008-08-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.17"
>1.17
  (MSCHILLI on 2008-07-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.16"
>1.16
  (MSCHILLI on 2008-05-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.15"
>1.15
  (MSCHILLI on 2008-02-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.14"
>1.14
  (MSCHILLI on 2007-11-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.13"
>1.13
  (MSCHILLI on 2007-10-14)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.12"
>1.12
  (MSCHILLI on 2007-06-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.11"
>1.11
  (MSCHILLI on 2007-06-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.10"
>1.10
  (MSCHILLI on 2007-04-04)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.09"
>1.09
  (MSCHILLI on 2007-02-10)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.08"
>1.08
  (MSCHILLI on 2006-11-25)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.07"
>1.07
  (MSCHILLI on 2006-10-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.06"
>1.06
  (MSCHILLI on 2006-07-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.05"
>1.05
  (MSCHILLI on 2006-06-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.04"
>1.04
  (MSCHILLI on 2006-03-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.03"
>1.03
  (MSCHILLI on 2006-02-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.02"
>1.02
  (MSCHILLI on 2005-12-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-1.01"
>1.01
  (MSCHILLI on 2005-10-02)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.52"
>0.52
  (MSCHILLI on 2005-05-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.51"
>0.51
  (MSCHILLI on 2005-01-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.50"
>0.50
  (MSCHILLI on 2004-12-21)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.49"
>0.49
  (MSCHILLI on 2004-11-10)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.48"
>0.48
  (MSCHILLI on 2004-08-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.46"
>0.46
  (MSCHILLI on 2004-06-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.45"
>0.45
  (MSCHILLI on 2004-05-27)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.44"
>0.44
  (MSCHILLI on 2004-05-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.43"
>0.43
  (MSCHILLI on 2004-03-25)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.42"
>0.42
  (MSCHILLI on 2004-02-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.41"
>0.41
  (MSCHILLI on 2003-12-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.40"
>0.40
  (MSCHILLI on 2003-11-15)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.39"
>0.39
  (MSCHILLI on 2003-10-24)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.38"
>0.38
  (MSCHILLI on 2003-10-05)</option>
<option
  
  value="PNE/Log-Log4perl-0.37"
>0.37
  (PNE on 2003-09-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.37"
>0.37
  (MSCHILLI on 2003-09-19)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.36"
>0.36
  (MSCHILLI on 2003-07-29)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.35"
>0.35
  (MSCHILLI on 2003-07-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.34"
>0.34
  (MSCHILLI on 2003-06-13)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.33"
>0.33
  (MSCHILLI on 2003-06-03)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.32"
>0.32
  (MSCHILLI on 2003-05-22)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.31"
>0.31
  (MSCHILLI on 2003-05-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.30"
>0.30
  (MSCHILLI on 2003-03-20)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.29"
>0.29
  (MSCHILLI on 2003-02-01)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.28"
>0.28
  (MSCHILLI on 2003-01-30)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.27"
>0.27
  (MSCHILLI on 2002-12-07)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.26"
>0.26
  (MSCHILLI on 2002-11-12)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.24"
>0.24
  (MSCHILLI on 2002-09-28)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.23"
>0.23
  (MSCHILLI on 2002-09-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.22"
>0.22
  (MSCHILLI on 2002-08-17)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.21"
>0.21
  (MSCHILLI on 2002-08-09)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.20"
>0.20
  (MSCHILLI on 2002-07-23)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.19"
>0.19
  (MSCHILLI on 2002-07-16)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.18"
>0.18
  (MSCHILLI on 2002-07-16)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.17"
>0.17
  (MSCHILLI on 2002-07-16)</option>
<option
  
  value="MSCHILLI/Log-Log4perl-0.16"
>0.16
  (MSCHILLI on 2002-07-11)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/Log-Log4perl">Log-Log4perl-1.57</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage four &#10;
          • 376 direct dependents &#10;          • 1144 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="15"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="Log-Log4perl-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="Log-Log4perl-1.57">
    <input type="hidden" name="author" value="ETJ">
    <input type="hidden" name="distribution" value="Log-Log4perl">
    <button type="submit" class="favorite highlight"><span>107</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./Log::Log4perl.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>107</span> ++</a>
</div>
   / <span>Log::Log4perl</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./Log::Log4perl.html#NAME">NAME</a></li>
  <li><a href="./Log::Log4perl.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./Log::Log4perl.html#ABSTRACT">ABSTRACT</a></li>
  <li><a href="./Log::Log4perl.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./Log::Log4perl.html#How-to-use-it">How to use it</a>
    <ul>
      <li><a href="./Log::Log4perl.html#Initialize-via-a-configuration-file">Initialize via a configuration file</a></li>
      <li><a href="./Log::Log4perl.html#Log-Levels">Log Levels</a></li>
      <li><a href="./Log::Log4perl.html#Log-and-die-or-warn">Log and die or warn</a></li>
      <li><a href="./Log::Log4perl.html#Appenders">Appenders</a></li>
      <li><a href="./Log::Log4perl.html#Additional-Appenders-via-Log::Dispatch">Additional Appenders via Log::Dispatch</a></li>
      <li><a href="./Log::Log4perl.html#Appender-Example">Appender Example</a></li>
      <li><a href="./Log::Log4perl.html#Logging-newlines">Logging newlines</a></li>
      <li><a href="./Log::Log4perl.html#Configuration-files">Configuration files</a></li>
      <li><a href="./Log::Log4perl.html#Log-Layouts">Log Layouts</a></li>
      <li><a href="./Log::Log4perl.html#Penalties">Penalties</a></li>
    </ul>
  </li>
  <li><a href="./Log::Log4perl.html#Categories">Categories</a>
    <ul>
      <li><a href="./Log::Log4perl.html#Turn-off-a-component">Turn off a component</a></li>
      <li><a href="./Log::Log4perl.html#Return-Values">Return Values</a></li>
      <li><a href="./Log::Log4perl.html#Pitfalls-with-Categories">Pitfalls with Categories</a></li>
      <li><a href="./Log::Log4perl.html#Initialize-once-and-only-once">Initialize once and only once</a></li>
      <li><a href="./Log::Log4perl.html#Custom-Filters">Custom Filters</a></li>
      <li><a href="./Log::Log4perl.html#Performance">Performance</a></li>
    </ul>
  </li>
  <li><a href="./Log::Log4perl.html#Cool-Tricks">Cool Tricks</a>
    <ul>
      <li><a href="./Log::Log4perl.html#Shortcuts">Shortcuts</a></li>
      <li><a href="./Log::Log4perl.html#Alternative-initialization">Alternative initialization</a></li>
      <li><a href="./Log::Log4perl.html#Using-LWP-to-parse-URLs">Using LWP to parse URLs</a></li>
      <li><a href="./Log::Log4perl.html#Automatic-reloading-of-changed-configuration-files">Automatic reloading of changed configuration files</a></li>
      <li><a href="./Log::Log4perl.html#Variable-Substitution">Variable Substitution</a></li>
      <li><a href="./Log::Log4perl.html#Perl-Hooks-in-the-Configuration-File">Perl Hooks in the Configuration File</a></li>
      <li><a href="./Log::Log4perl.html#Restricting-what-Opcodes-can-be-in-a-Perl-Hook">Restricting what Opcodes can be in a Perl Hook</a></li>
      <li><a href="./Log::Log4perl.html#Changing-the-Log-Level-on-a-Logger">Changing the Log Level on a Logger</a></li>
      <li><a href="./Log::Log4perl.html#Custom-Log-Levels">Custom Log Levels</a></li>
      <li><a href="./Log::Log4perl.html#System-wide-log-levels">System-wide log levels</a></li>
      <li><a href="./Log::Log4perl.html#Easy-Mode">Easy Mode</a></li>
      <li><a href="./Log::Log4perl.html#Stealth-loggers">Stealth loggers</a></li>
      <li><a href="./Log::Log4perl.html#Nested-Diagnostic-Context-(NDC)">Nested Diagnostic Context (NDC)</a></li>
      <li><a href="./Log::Log4perl.html#Mapped-Diagnostic-Context-(MDC)">Mapped Diagnostic Context (MDC)</a></li>
      <li><a href="./Log::Log4perl.html#Resurrecting-hidden-Log4perl-Statements">Resurrecting hidden Log4perl Statements</a></li>
      <li><a href="./Log::Log4perl.html#Access-defined-appenders">Access defined appenders</a></li>
      <li><a href="./Log::Log4perl.html#Modify-appender-thresholds">Modify appender thresholds</a></li>
    </ul>
  </li>
  <li><a href="./Log::Log4perl.html#Advanced-configuration-within-Perl">Advanced configuration within Perl</a></li>
  <li><a href="./Log::Log4perl.html#How-about-Log::Dispatch::Config?">How about Log::Dispatch::Config?</a></li>
  <li><a href="./Log::Log4perl.html#Using-Log::Log4perl-with-wrapper-functions-and-classes">Using Log::Log4perl with wrapper functions and classes</a></li>
  <li><a href="./Log::Log4perl.html#Access-to-Internals">Access to Internals</a></li>
  <li><a href="./Log::Log4perl.html#Dirty-Tricks">Dirty Tricks</a></li>
  <li><a href="./Log::Log4perl.html#EXAMPLE">EXAMPLE</a></li>
  <li><a href="./Log::Log4perl.html#INSTALLATION">INSTALLATION</a></li>
  <li><a href="./Log::Log4perl.html#DEVELOPMENT">DEVELOPMENT</a></li>
  <li><a href="./Log::Log4perl.html#REFERENCES">REFERENCES</a></li>
  <li><a href="./Log::Log4perl.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="./Log::Log4perl.html#AUTHORS">AUTHORS</a></li>
  <li><a href="./Log::Log4perl.html#LICENSE">LICENSE</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>Log::Log4perl - Log4j implementation for Perl</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>                # Easy mode if you like it simple ...

    use Log::Log4perl qw(:easy);
    Log::Log4perl-&gt;easy_init($ERROR);

    DEBUG &quot;This doesn&#39;t go anywhere&quot;;
    ERROR &quot;This gets logged&quot;;

        # ... or standard mode for more features:

    Log::Log4perl::init(&#39;/etc/log4perl.conf&#39;);
    
    --or--
    
        # Check config every 10 secs
    Log::Log4perl::init_and_watch(&#39;/etc/log4perl.conf&#39;,10);

    --then--
    
    $logger = Log::Log4perl-&gt;get_logger(&#39;house.bedrm.desk.topdrwr&#39;);
    
    $logger-&gt;debug(&#39;this is a debug message&#39;);
    $logger-&gt;info(&#39;this is an info message&#39;);
    $logger-&gt;warn(&#39;etc&#39;);
    $logger-&gt;error(&#39;..&#39;);
    $logger-&gt;fatal(&#39;..&#39;);
    
    #####/etc/log4perl.conf###############################
    log4perl.logger.house              = WARN,  FileAppndr1
    log4perl.logger.house.bedroom.desk = DEBUG, FileAppndr1
    
    log4perl.appender.FileAppndr1      = Log::Log4perl::Appender::File
    log4perl.appender.FileAppndr1.filename = desk.log 
    log4perl.appender.FileAppndr1.layout   = \
                            Log::Log4perl::Layout::SimpleLayout
    ######################################################</code></pre>

<h1 id="ABSTRACT">ABSTRACT</h1>

<p>Log::Log4perl provides a powerful logging API for your application</p>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>Log::Log4perl lets you remote-control and fine-tune the logging behaviour of your system from the outside. It implements the widely popular (Java-based) Log4j logging package in pure Perl.</p>

<p><b>For a detailed tutorial on Log::Log4perl usage, please read</b></p>

<p><a href="http://www.perl.com/pub/a/2002/09/11/log4perl.html">http://www.perl.com/pub/a/2002/09/11/log4perl.html</a></p>

<p>Logging beats a debugger if you want to know what&#39;s going on in your code during runtime. However, traditional logging packages are too static and generate a flood of log messages in your log files that won&#39;t help you.</p>

<p><code>Log::Log4perl</code> is different. It allows you to control the number of logging messages generated at three different levels:</p>

<ul>

<li><p>At a central location in your system (either in a configuration file or in the startup code) you specify <i>which components</i> (classes, functions) of your system should generate logs.</p>

</li>
<li><p>You specify how detailed the logging of these components should be by specifying logging <i>levels</i>.</p>

</li>
<li><p>You also specify which so-called <i>appenders</i> you want to feed your log messages to (&quot;Print it to the screen and also append it to /tmp/my.log&quot;) and which format (&quot;Write the date first, then the file name and line number, and then the log message&quot;) they should be in.</p>

</li>
</ul>

<p>This is a very powerful and flexible mechanism. You can turn on and off your logs at any time, specify the level of detail and make that dependent on the subsystem that&#39;s currently executed.</p>

<p>Let me give you an example: You might find out that your system has a problem in the <code>MySystem::Helpers::ScanDir</code> component. Turning on detailed debugging logs all over the system would generate a flood of useless log messages and bog your system down beyond recognition. With <code>Log::Log4perl</code>, however, you can tell the system: &quot;Continue to log only severe errors to the log file. Open a second log file, turn on full debug logs in the <code>MySystem::Helpers::ScanDir</code> component and dump all messages originating from there into the new log file&quot;. And all this is possible by just changing the parameters in a configuration file, which your system can re-read even while it&#39;s running!</p>

<h1 id="How-to-use-it"><a id="How"></a>How to use it</h1>

<p>The <code>Log::Log4perl</code> package can be initialized in two ways: Either via Perl commands or via a <code>log4j</code>-style configuration file.</p>

<h2 id="Initialize-via-a-configuration-file"><a id="Initialize"></a>Initialize via a configuration file</h2>

<p>This is the easiest way to prepare your system for using <code>Log::Log4perl</code>. Use a configuration file like this:</p>

<pre><code>    ############################################################
    # A simple root logger with a Log::Log4perl::Appender::File 
    # file appender in Perl.
    ############################################################
    log4perl.rootLogger=ERROR, LOGFILE
    
    log4perl.appender.LOGFILE=Log::Log4perl::Appender::File
    log4perl.appender.LOGFILE.filename=/var/log/myerrs.log
    log4perl.appender.LOGFILE.mode=append
    
    log4perl.appender.LOGFILE.layout=PatternLayout
    log4perl.appender.LOGFILE.layout.ConversionPattern=[%r] %F %L %c - %m%n</code></pre>

<p>These lines define your standard logger that&#39;s appending severe errors to <code>/var/log/myerrs.log</code>, using the format</p>

<pre><code>    [millisecs] source-filename line-number class - message newline</code></pre>

<p>Assuming that this configuration file is saved as <code>log.conf</code>, you need to read it in the startup section of your code, using the following commands:</p>

<pre><code>  use Log::Log4perl;
  Log::Log4perl-&gt;init(&quot;log.conf&quot;);</code></pre>

<p>After that&#39;s done <i>somewhere</i> in the code, you can retrieve logger objects <i>anywhere</i> in the code. Note that there&#39;s no need to carry any logger references around with your functions and methods. You can get a logger anytime via a singleton mechanism:</p>

<pre><code>    package My::MegaPackage;
    use  Log::Log4perl;

    sub some_method {
        my($param) = @_;

        my $log = Log::Log4perl-&gt;get_logger(&quot;My::MegaPackage&quot;);

        $log-&gt;debug(&quot;Debug message&quot;);
        $log-&gt;info(&quot;Info message&quot;);
        $log-&gt;error(&quot;Error message&quot;);

        ...
    }</code></pre>

<p>With the configuration file above, <code>Log::Log4perl</code> will write &quot;Error message&quot; to the specified log file, but won&#39;t do anything for the <code>debug()</code> and <code>info()</code> calls, because the log level has been set to <code>ERROR</code> for all components in the first line of configuration file shown above.</p>

<p>Why <code>Log::Log4perl-&gt;get_logger</code> and not <code>Log::Log4perl-&gt;new</code>? We don&#39;t want to create a new object every time. Usually in OO-Programming, you create an object once and use the reference to it to call its methods. However, this requires that you pass around the object to all functions and the last thing we want is pollute each and every function/method we&#39;re using with a handle to the <code>Logger</code>:</p>

<pre><code>    sub function {  # Brrrr!!
        my($logger, $some, $other, $parameters) = @_;
    }</code></pre>

<p>Instead, if a function/method wants a reference to the logger, it just calls the Logger&#39;s static <code>get_logger($category)</code> method to obtain a reference to the <i>one and only</i> possible logger object of a certain category. That&#39;s called a <i>singleton</i> if you&#39;re a Gamma fan.</p>

<p>How does the logger know which messages it is supposed to log and which ones to suppress? <code>Log::Log4perl</code> works with inheritance: The config file above didn&#39;t specify anything about <code>My::MegaPackage</code>. And yet, we&#39;ve defined a logger of the category <code>My::MegaPackage</code>. In this case, <code>Log::Log4perl</code> will walk up the namespace hierarchy (<code>My</code> and then we&#39;re at the root) to figure out if a log level is defined somewhere. In the case above, the log level at the root (root <i>always</i> defines a log level, but not necessarily an appender) defines that the log level is supposed to be <code>ERROR</code> -- meaning that <i>DEBUG</i> and <i>INFO</i> messages are suppressed. Note that this &#39;inheritance&#39; is unrelated to Perl&#39;s class inheritance, it is merely related to the logger namespace. By the way, if you&#39;re ever in doubt about what a logger&#39;s category is, use <code>$logger-&gt;category()</code> to retrieve it.</p>

<h2 id="Log-Levels"><a id="Log"></a>Log Levels</h2>

<p>There are six predefined log levels: <code>FATAL</code>, <code>ERROR</code>, <code>WARN</code>, <code>INFO</code>, <code>DEBUG</code>, and <code>TRACE</code> (in descending priority). Your configured logging level has to at least match the priority of the logging message.</p>

<p>If your configured logging level is <code>WARN</code>, then messages logged with <code>info()</code>, <code>debug()</code>, and <code>trace()</code> will be suppressed. <code>fatal()</code>, <code>error()</code> and <code>warn()</code> will make their way through, because their priority is higher or equal than the configured setting.</p>

<p>Instead of calling the methods</p>

<pre><code>    $logger-&gt;trace(&quot;...&quot;);  # Log a trace message
    $logger-&gt;debug(&quot;...&quot;);  # Log a debug message
    $logger-&gt;info(&quot;...&quot;);   # Log a info message
    $logger-&gt;warn(&quot;...&quot;);   # Log a warn message
    $logger-&gt;error(&quot;...&quot;);  # Log a error message
    $logger-&gt;fatal(&quot;...&quot;);  # Log a fatal message</code></pre>

<p>you could also call the <code>log()</code> method with the appropriate level using the constants defined in <code>Log::Log4perl::Level</code>:</p>

<pre><code>    use Log::Log4perl::Level;

    $logger-&gt;log($TRACE, &quot;...&quot;);
    $logger-&gt;log($DEBUG, &quot;...&quot;);
    $logger-&gt;log($INFO, &quot;...&quot;);
    $logger-&gt;log($WARN, &quot;...&quot;);
    $logger-&gt;log($ERROR, &quot;...&quot;);
    $logger-&gt;log($FATAL, &quot;...&quot;);</code></pre>

<p>This form is rarely used, but it comes in handy if you want to log at different levels depending on an exit code of a function:</p>

<pre><code>    $logger-&gt;log( $exit_level{ $rc }, &quot;...&quot;);</code></pre>

<p>As for needing more logging levels than these predefined ones: It&#39;s usually best to steer your logging behaviour via the category mechanism instead.</p>

<p>If you need to find out if the currently configured logging level would allow a logger&#39;s logging statement to go through, use the logger&#39;s <code>is_<i>level</i>()</code> methods:</p>

<pre><code>    $logger-&gt;is_trace()    # True if trace messages would go through
    $logger-&gt;is_debug()    # True if debug messages would go through
    $logger-&gt;is_info()     # True if info messages would go through
    $logger-&gt;is_warn()     # True if warn messages would go through
    $logger-&gt;is_error()    # True if error messages would go through
    $logger-&gt;is_fatal()    # True if fatal messages would go through</code></pre>

<p>Example: <code>$logger-&gt;is_warn()</code> returns true if the logger&#39;s current level, as derived from either the logger&#39;s category (or, in absence of that, one of the logger&#39;s parent&#39;s level setting) is <code>$WARN</code>, <code>$ERROR</code> or <code>$FATAL</code>.</p>

<p>Also available are a series of more Java-esque functions which return the same values. These are of the format <code>is<i>Level</i>Enabled()</code>, so <code>$logger-&gt;isDebugEnabled()</code> is synonymous to <code>$logger-&gt;is_debug()</code>.</p>

<p>These level checking functions will come in handy later, when we want to block unnecessary expensive parameter construction in case the logging level is too low to log the statement anyway, like in:</p>

<pre><code>    if($logger-&gt;is_error()) {
        $logger-&gt;error(&quot;Erroneous array: @super_long_array&quot;);
    }</code></pre>

<p>If we had just written</p>

<pre><code>    $logger-&gt;error(&quot;Erroneous array: @super_long_array&quot;);</code></pre>

<p>then Perl would have interpolated <code>@super_long_array</code> into the string via an expensive operation only to figure out shortly after that the string can be ignored entirely because the configured logging level is lower than <code>$ERROR</code>.</p>

<p>The to-be-logged message passed to all of the functions described above can consist of an arbitrary number of arguments, which the logging functions just chain together to a single string. Therefore</p>

<pre><code>    $logger-&gt;debug(&quot;Hello &quot;, &quot;World&quot;, &quot;!&quot;);  # and
    $logger-&gt;debug(&quot;Hello World!&quot;);</code></pre>

<p>are identical.</p>

<p>Note that even if one of the methods above returns true, it doesn&#39;t necessarily mean that the message will actually get logged. What is_debug() checks is that the logger used is configured to let a message of the given priority (DEBUG) through. But after this check, Log4perl will eventually apply custom filters and forward the message to one or more appenders. None of this gets checked by is_xxx(), for the simple reason that it&#39;s impossible to know what a custom filter does with a message without having the actual message or what an appender does to a message without actually having it log it.</p>

<h2 id="Log-and-die-or-warn"><a id="Log1"></a>Log and die or warn</h2>

<p>Often, when you croak / carp / warn / die, you want to log those messages. Rather than doing the following:</p>

<pre><code>    $logger-&gt;fatal($err) &amp;&amp; die($err);</code></pre>

<p>you can use the following:</p>

<pre><code>    $logger-&gt;logdie($err);</code></pre>

<p>And if instead of using</p>

<pre><code>    warn($message);
    $logger-&gt;warn($message);</code></pre>

<p>to both issue a warning via Perl&#39;s warn() mechanism and make sure you have the same message in the log file as well, use:</p>

<pre><code>    $logger-&gt;logwarn($message);</code></pre>

<p>Since there is an ERROR level between WARN and FATAL, there are two additional helper functions in case you&#39;d like to use ERROR for either warn() or die():</p>

<pre><code>    $logger-&gt;error_warn();
    $logger-&gt;error_die();</code></pre>

<p>Finally, there&#39;s the Carp functions that, in addition to logging, also pass the stringified message to their companions in the Carp package:</p>

<pre><code>    $logger-&gt;logcarp();        # warn w/ 1-level stack trace
    $logger-&gt;logcluck();       # warn w/ full stack trace
    $logger-&gt;logcroak();       # die w/ 1-level stack trace
    $logger-&gt;logconfess();     # die w/ full stack trace</code></pre>

<h2 id="Appenders">Appenders</h2>

<p>If you don&#39;t define any appenders, nothing will happen. Appenders will be triggered whenever the configured logging level requires a message to be logged and not suppressed.</p>

<p><code>Log::Log4perl</code> doesn&#39;t define any appenders by default, not even the root logger has one.</p>

<p><code>Log::Log4perl</code> already comes with a standard set of appenders:</p>

<pre><code>    Log::Log4perl::Appender::Screen
    Log::Log4perl::Appender::ScreenColoredLevels
    Log::Log4perl::Appender::File
    Log::Log4perl::Appender::Socket
    Log::Log4perl::Appender::DBI
    Log::Log4perl::Appender::Synchronized
    Log::Log4perl::Appender::RRDs</code></pre>

<p>to log to the screen, to files and to databases.</p>

<p>On CPAN, you can find additional appenders like</p>

<pre><code>    Log::Log4perl::Layout::XMLLayout</code></pre>

<p>by Guido Carls &lt;gcarls@cpan.org&gt;. It allows for hooking up Log::Log4perl with the graphical Log Analyzer Chainsaw (see <a href="https://metacpan.org/pod/distribution/Log-Log4perl/lib/Log/Log4perl/FAQ.pm#Can-I-use-Log::Log4perl-with-log4j&#39;s-Chainsaw?">&quot;Can I use Log::Log4perl with log4j&#39;s Chainsaw?&quot; in Log::Log4perl::FAQ</a>).</p>

<h2 id="Additional-Appenders-via-Log::Dispatch"><a id="Additional"></a>Additional Appenders via Log::Dispatch</h2>

<p><code>Log::Log4perl</code> also supports <i>Dave Rolskys</i> excellent <code>Log::Dispatch</code> framework which implements a wide variety of different appenders.</p>

<p>Here&#39;s the list of appender modules currently available via <code>Log::Dispatch</code>:</p>

<pre><code>       Log::Dispatch::ApacheLog
       Log::Dispatch::DBI (by Tatsuhiko Miyagawa)
       Log::Dispatch::Email,
       Log::Dispatch::Email::MailSend,
       Log::Dispatch::Email::MailSendmail,
       Log::Dispatch::Email::MIMELite
       Log::Dispatch::File
       Log::Dispatch::FileRotate (by Mark Pfeiffer)
       Log::Dispatch::Handle
       Log::Dispatch::Screen
       Log::Dispatch::Syslog
       Log::Dispatch::Tk (by Dominique Dumont)</code></pre>

<p>Please note that in order to use any of these additional appenders, you have to fetch Log::Dispatch from CPAN and install it. Also the particular appender you&#39;re using might require installing the particular module.</p>

<p>For additional information on appenders, please check the <a href="https://metacpan.org/pod/Log::Log4perl::Appender">Log::Log4perl::Appender</a> manual page.</p>

<h2 id="Appender-Example"><a id="Appender"></a>Appender Example</h2>

<p>Now let&#39;s assume that we want to log <code>info()</code> or higher prioritized messages in the <code>Foo::Bar</code> category to both STDOUT and to a log file, say <code>test.log</code>. In the initialization section of your system, just define two appenders using the readily available <code>Log::Log4perl::Appender::File</code> and <code>Log::Log4perl::Appender::Screen</code> modules:</p>

<pre><code>  use Log::Log4perl;

     # Configuration in a string ...
  my $conf = q(
    log4perl.category.Foo.Bar          = INFO, Logfile, Screen

    log4perl.appender.Logfile          = Log::Log4perl::Appender::File
    log4perl.appender.Logfile.filename = test.log
    log4perl.appender.Logfile.layout   = Log::Log4perl::Layout::PatternLayout
    log4perl.appender.Logfile.layout.ConversionPattern = [%r] %F %L %m%n

    log4perl.appender.Screen         = Log::Log4perl::Appender::Screen
    log4perl.appender.Screen.stderr  = 0
    log4perl.appender.Screen.layout = Log::Log4perl::Layout::SimpleLayout
  );

     # ... passed as a reference to init()
  Log::Log4perl::init( \$conf );</code></pre>

<p>Once the initialization shown above has happened once, typically in the startup code of your system, just use the defined logger anywhere in your system:</p>

<pre><code>  ##########################
  # ... in some function ...
  ##########################
  my $log = Log::Log4perl::get_logger(&quot;Foo::Bar&quot;);

    # Logs both to STDOUT and to the file test.log
  $log-&gt;info(&quot;Important Info!&quot;);</code></pre>

<p>The <code>layout</code> settings specified in the configuration section define the format in which the message is going to be logged by the specified appender. The format shown for the file appender is logging not only the message but also the number of milliseconds since the program has started (%r), the name of the file the call to the logger has happened and the line number there (%F and %L), the message itself (%m) and a OS-specific newline character (%n):</p>

<pre><code>    [187] ./myscript.pl 27 Important Info!</code></pre>

<p>The screen appender above, on the other hand, uses a <code>SimpleLayout</code>, which logs the debug level, a hyphen (-) and the log message:</p>

<pre><code>    INFO - Important Info!</code></pre>

<p>For more detailed info on layout formats, see <a href="./Log::Log4perl.html#Log-Layouts">&quot;Log Layouts&quot;</a>.</p>

<p>In the configuration sample above, we chose to define a <i>category</i> logger (<code>Foo::Bar</code>). This will cause only messages originating from this specific category logger to be logged in the defined format and locations.</p>

<h2 id="Logging-newlines"><a id="Logging"></a>Logging newlines</h2>

<p>There&#39;s some controversy between different logging systems as to when and where newlines are supposed to be added to logged messages.</p>

<p>The Log4perl way is that a logging statement <i>should not</i> contain a newline:</p>

<pre><code>    $logger-&gt;info(&quot;Some message&quot;);
    $logger-&gt;info(&quot;Another message&quot;);</code></pre>

<p>If this is supposed to end up in a log file like</p>

<pre><code>    Some message
    Another message</code></pre>

<p>then an appropriate appender layout like &quot;%m%n&quot; will take care of adding a newline at the end of each message to make sure every message is printed on its own line.</p>

<p>Other logging systems, Log::Dispatch in particular, recommend adding the newline to the log statement. This doesn&#39;t work well, however, if you, say, replace your file appender by a database appender, and all of a sudden those newlines scattered around the code don&#39;t make sense anymore.</p>

<p>Assigning matching layouts to different appenders and leaving newlines out of the code solves this problem. If you inherited code that has logging statements with newlines and want to make it work with Log4perl, read the <a href="https://metacpan.org/pod/Log::Log4perl::Layout::PatternLayout">Log::Log4perl::Layout::PatternLayout</a> documentation on how to accomplish that.</p>

<h2 id="Configuration-files"><a id="Configuration"></a>Configuration files</h2>

<p>As shown above, you can define <code>Log::Log4perl</code> loggers both from within your Perl code or from configuration files. The latter have the unbeatable advantage that you can modify your system&#39;s logging behaviour without interfering with the code at all. So even if your code is being run by somebody who&#39;s totally oblivious to Perl, they still can adapt the module&#39;s logging behaviour to their needs.</p>

<p><code>Log::Log4perl</code> has been designed to understand <code>Log4j</code> configuration files -- as used by the original Java implementation. Instead of reiterating the format description in [2], let me just list three examples (also derived from [2]), which should also illustrate how it works:</p>

<pre><code>    log4j.rootLogger=DEBUG, A1
    log4j.appender.A1=org.apache.log4j.ConsoleAppender
    log4j.appender.A1.layout=org.apache.log4j.PatternLayout
    log4j.appender.A1.layout.ConversionPattern=%-4r %-5p %c %x - %m%n</code></pre>

<p>This enables messages of priority <code>DEBUG</code> or higher in the root hierarchy and has the system write them to the console. <code>ConsoleAppender</code> is a Java appender, but <code>Log::Log4perl</code> jumps through a significant number of hoops internally to map these to their corresponding Perl classes, <code>Log::Log4perl::Appender::Screen</code> in this case.</p>

<p>Second example:</p>

<pre><code>    log4perl.rootLogger=DEBUG, A1
    log4perl.appender.A1=Log::Log4perl::Appender::Screen
    log4perl.appender.A1.layout=PatternLayout
    log4perl.appender.A1.layout.ConversionPattern=%d %-5p %c - %m%n
    log4perl.logger.com.foo=WARN</code></pre>

<p>This defines two loggers: The root logger and the <code>com.foo</code> logger. The root logger is easily triggered by debug-messages, but the <code>com.foo</code> logger makes sure that messages issued within the <code>Com::Foo</code> component and below are only forwarded to the appender if they&#39;re of priority <i>warning</i> or higher.</p>

<p>Note that the <code>com.foo</code> logger doesn&#39;t define an appender. Therefore, it will just propagate the message up the hierarchy until the root logger picks it up and forwards it to the one and only appender of the root category, using the format defined for it.</p>

<p>Third example:</p>

<pre><code>    log4j.rootLogger=DEBUG, stdout, R
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%5p (%F:%L) - %m%n
    log4j.appender.R=org.apache.log4j.RollingFileAppender
    log4j.appender.R.File=example.log
    log4j.appender.R.layout=org.apache.log4j.PatternLayout
    log4j.appender.R.layout.ConversionPattern=%p %c - %m%n</code></pre>

<p>The root logger defines two appenders here: <code>stdout</code>, which uses <code>org.apache.log4j.ConsoleAppender</code> (ultimately mapped by <code>Log::Log4perl</code> to <a href="https://metacpan.org/pod/Log::Log4perl::Appender::Screen">Log::Log4perl::Appender::Screen</a>) to write to the screen. And <code>R</code>, a <code>org.apache.log4j.RollingFileAppender</code> (mapped by <code>Log::Log4perl</code> to <a href="https://metacpan.org/pod/Log::Dispatch::FileRotate">Log::Dispatch::FileRotate</a> with the <code>File</code> attribute specifying the log file.</p>

<p>See <a href="https://metacpan.org/pod/Log::Log4perl::Config">Log::Log4perl::Config</a> for more examples and syntax explanations.</p>

<h2 id="Log-Layouts"><a id="Log2"></a>Log Layouts</h2>

<p>If the logging engine passes a message to an appender, because it thinks it should be logged, the appender doesn&#39;t just write it out haphazardly. There&#39;s ways to tell the appender how to format the message and add all sorts of interesting data to it: The date and time when the event happened, the file, the line number, the debug level of the logger and others.</p>

<p>There&#39;s currently two layouts defined in <code>Log::Log4perl</code>: <code>Log::Log4perl::Layout::SimpleLayout</code> and <code>Log::Log4perl::Layout::PatternLayout</code>:</p>

<dl>

<dt id="Log::Log4perl::SimpleLayout"><a id="Log3"></a><code>Log::Log4perl::SimpleLayout</code></dt>
<dd>

<p>formats a message in a simple way and just prepends it by the debug level and a hyphen: <code>&quot;$level - $message</code>, for example <code>&quot;FATAL - Can&#39;t open password file&quot;</code>.</p>

</dd>
<dt id="Log::Log4perl::Layout::PatternLayout"><a id="Log4"></a><code>Log::Log4perl::Layout::PatternLayout</code></dt>
<dd>

<p>on the other hand is very powerful and allows for a very flexible format in <code>printf</code>-style. The format string can contain a number of placeholders which will be replaced by the logging engine when it&#39;s time to log the message:</p>

<pre><code>    %c Category of the logging event.
    %C Fully qualified package (or class) name of the caller
    %d Current date in yyyy/MM/dd hh:mm:ss format
    %F File where the logging event occurred
    %H Hostname (if Sys::Hostname is available)
    %l Fully qualified name of the calling method followed by the
       callers source the file name and line number between 
       parentheses.
    %L Line number within the file where the log statement was issued
    %m The message to be logged
    %m{chomp} The message to be logged, stripped off a trailing newline
    %M Method or function where the logging request was issued
    %n Newline (OS-independent)
    %p Priority of the logging event
    %P pid of the current process
    %r Number of milliseconds elapsed from program start to logging 
       event
    %R Number of milliseconds elapsed from last logging event to
       current logging event 
    %T A stack trace of functions called
    %x The topmost NDC (see below)
    %X{key} The entry &#39;key&#39; of the MDC (see below)
    %% A literal percent (%) sign</code></pre>

<p>NDC and MDC are explained in <a href="./Log::Log4perl.html#Nested-Diagnostic-Context-(NDC)">&quot;Nested Diagnostic Context (NDC)&quot;</a> and <a href="./Log::Log4perl.html#Mapped-Diagnostic-Context-(MDC)">&quot;Mapped Diagnostic Context (MDC)&quot;</a>.</p>

<p>Also, <code>%d</code> can be fine-tuned to display only certain characteristics of a date, according to the SimpleDateFormat in the Java World (<a href="http://java.sun.com/j2se/1.3/docs/api/java/text/SimpleDateFormat.html">http://java.sun.com/j2se/1.3/docs/api/java/text/SimpleDateFormat.html</a>)</p>

<p>In this way, <code>%d{HH:mm}</code> displays only hours and minutes of the current date, while <code>%d{yy, EEEE}</code> displays a two-digit year, followed by a spelled-out day (like <code>Wednesday</code>).</p>

<p>Similar options are available for shrinking the displayed category or limit file/path components, <code>%F{1}</code> only displays the source file <i>name</i> without any path components while <code>%F</code> logs the full path. %c{2} only logs the last two components of the current category, <code>Foo::Bar::Baz</code> becomes <code>Bar::Baz</code> and saves space.</p>

<p>If those placeholders aren&#39;t enough, then you can define your own right in the config file like this:</p>

<pre><code>    log4perl.PatternLayout.cspec.U = sub { return &quot;UID $&lt;&quot; }</code></pre>

<p>See <a href="https://metacpan.org/pod/Log::Log4perl::Layout::PatternLayout">Log::Log4perl::Layout::PatternLayout</a> for further details on customized specifiers.</p>

<p>Please note that the subroutines you&#39;re defining in this way are going to be run in the <code>main</code> namespace, so be sure to fully qualify functions and variables if they&#39;re located in different packages.</p>

<p>SECURITY NOTE: this feature means arbitrary perl code can be embedded in the config file. In the rare case where the people who have access to your config file are different from the people who write your code and shouldn&#39;t have execute rights, you might want to call</p>

<pre><code>    Log::Log4perl::Config-&gt;allow_code(0);</code></pre>

<p>before you call init(). Alternatively you can supply a restricted set of Perl opcodes that can be embedded in the config file as described in <a href="./Log::Log4perl.html#Restricting-what-Opcodes-can-be-in-a-Perl-Hook">&quot;Restricting what Opcodes can be in a Perl Hook&quot;</a>.</p>

</dd>
</dl>

<p>All placeholders are quantifiable, just like in <i>printf</i>. Following this tradition, <code>%-20c</code> will reserve 20 chars for the category and left-justify it.</p>

<p>For more details on logging and how to use the flexible and the simple format, check out the original <code>log4j</code> website under</p>

<p><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/SimpleLayout.html">SimpleLayout</a> and <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html">PatternLayout</a></p>

<h2 id="Penalties">Penalties</h2>

<p>Logging comes with a price tag. <code>Log::Log4perl</code> has been optimized to allow for maximum performance, both with logging enabled and disabled.</p>

<p>But you need to be aware that there&#39;s a small hit every time your code encounters a log statement -- no matter if logging is enabled or not. <code>Log::Log4perl</code> has been designed to keep this so low that it will be unnoticeable to most applications.</p>

<p>Here&#39;s a couple of tricks which help <code>Log::Log4perl</code> to avoid unnecessary delays:</p>

<p>You can save serious time if you&#39;re logging something like</p>

<pre><code>        # Expensive in non-debug mode!
    for (@super_long_array) {
        $logger-&gt;debug(&quot;Element: $_&quot;);
    }</code></pre>

<p>and <code>@super_long_array</code> is fairly big, so looping through it is pretty expensive. Only you, the programmer, knows that going through that <code>for</code> loop can be skipped entirely if the current logging level for the actual component is higher than <code>debug</code>. In this case, use this instead:</p>

<pre><code>        # Cheap in non-debug mode!
    if($logger-&gt;is_debug()) {
        for (@super_long_array) {
            $logger-&gt;debug(&quot;Element: $_&quot;);
        }
    }</code></pre>

<p>If you&#39;re afraid that generating the parameters to the logging function is fairly expensive, use closures:</p>

<pre><code>        # Passed as subroutine ref
    use Data::Dumper;
    $logger-&gt;debug(sub { Dumper($data) } );</code></pre>

<p>This won&#39;t unravel <code>$data</code> via Dumper() unless it&#39;s actually needed because it&#39;s logged.</p>

<p>Also, Log::Log4perl lets you specify arguments to logger functions in <i>message output filter syntax</i>:</p>

<pre><code>    $logger-&gt;debug(&quot;Structure: &quot;,
                   { filter =&gt; \&amp;Dumper,
                     value  =&gt; $someref });</code></pre>

<p>In this way, shortly before Log::Log4perl sending the message out to any appenders, it will be searching all arguments for hash references and treat them in a special way:</p>

<p>It will invoke the function given as a reference with the <code>filter</code> key (<code>Data::Dumper::Dumper()</code>) and pass it the value that came with the key named <code>value</code> as an argument. The anonymous hash in the call above will be replaced by the return value of the filter function.</p>

<h1 id="Categories">Categories</h1>

<p><b>Categories are also called &quot;Loggers&quot; in Log4perl, both refer to the same thing and these terms are used interchangeably.</b> <code>Log::Log4perl</code> uses <i>categories</i> to determine if a log statement in a component should be executed or suppressed at the current logging level. Most of the time, these categories are just the classes the log statements are located in:</p>

<pre><code>    package Candy::Twix;

    sub new { 
        my $logger = Log::Log4perl-&gt;get_logger(&quot;Candy::Twix&quot;);
        $logger-&gt;debug(&quot;Creating a new Twix bar&quot;);
        bless {}, shift;
    }
 
    # ...

    package Candy::Snickers;

    sub new { 
        my $logger = Log::Log4perl-&gt;get_logger(&quot;Candy.Snickers&quot;);
        $logger-&gt;debug(&quot;Creating a new Snickers bar&quot;);
        bless {}, shift;
    }

    # ...

    package main;
    Log::Log4perl-&gt;init(&quot;mylogdefs.conf&quot;);

        # =&gt; &quot;LOG&gt; Creating a new Snickers bar&quot;
    my $first = Candy::Snickers-&gt;new();
        # =&gt; &quot;LOG&gt; Creating a new Twix bar&quot;
    my $second = Candy::Twix-&gt;new();</code></pre>

<p>Note that you can separate your category hierarchy levels using either dots like in Java (.) or double-colons (::) like in Perl. Both notations are equivalent and are handled the same way internally.</p>

<p>However, categories are just there to make use of inheritance: if you invoke a logger in a sub-category, it will bubble up the hierarchy and call the appropriate appenders. Internally, categories are not related to the class hierarchy of the program at all -- they&#39;re purely virtual. You can use arbitrary categories -- for example in the following program, which isn&#39;t oo-style, but procedural:</p>

<pre><code>    sub print_portfolio {

        my $log = Log::Log4perl-&gt;get_logger(&quot;user.portfolio&quot;);
        $log-&gt;debug(&quot;Quotes requested: @_&quot;);

        for(@_) {
            print &quot;$_: &quot;, get_quote($_), &quot;\n&quot;;
        }
    }

    sub get_quote {

        my $log = Log::Log4perl-&gt;get_logger(&quot;internet.quotesystem&quot;);
        $log-&gt;debug(&quot;Fetching quote: $_[0]&quot;);

        return yahoo_quote($_[0]);
    }</code></pre>

<p>The logger in first function, <code>print_portfolio</code>, is assigned the (virtual) <code>user.portfolio</code> category. Depending on the <code>Log4perl</code> configuration, this will either call a <code>user.portfolio</code> appender, a <code>user</code> appender, or an appender assigned to root -- without <code>user.portfolio</code> having any relevance to the class system used in the program. The logger in the second function adheres to the <code>internet.quotesystem</code> category -- again, maybe because it&#39;s bundled with other Internet functions, but not because there would be a class of this name somewhere.</p>

<p>However, be careful, don&#39;t go overboard: if you&#39;re developing a system in object-oriented style, using the class hierarchy is usually your best choice. Think about the people taking over your code one day: The class hierarchy is probably what they know right up front, so it&#39;s easy for them to tune the logging to their needs.</p>

<h2 id="Turn-off-a-component"><a id="Turn"></a>Turn off a component</h2>

<p><code>Log4perl</code> doesn&#39;t only allow you to selectively switch <i>on</i> a category of log messages, you can also use the mechanism to selectively <i>disable</i> logging in certain components whereas logging is kept turned on in higher-level categories. This mechanism comes in handy if you find that while bumping up the logging level of a high-level (i. e. close to root) category, that one component logs more than it should,</p>

<p>Here&#39;s how it works:</p>

<pre><code>    ############################################################
    # Turn off logging in a lower-level category while keeping
    # it active in higher-level categories.
    ############################################################
    log4perl.rootLogger=DEBUG, LOGFILE
    log4perl.logger.deep.down.the.hierarchy = ERROR, LOGFILE

    # ... Define appenders ...</code></pre>

<p>This way, log messages issued from within <code>Deep::Down::The::Hierarchy</code> and below will be logged only if they&#39;re <code>ERROR</code> or worse, while in all other system components even <code>DEBUG</code> messages will be logged.</p>

<h2 id="Return-Values"><a id="Return"></a>Return Values</h2>

<p>All logging methods return values indicating if their message actually reached one or more appenders. If the message has been suppressed because of level constraints, <code>undef</code> is returned.</p>

<p>For example,</p>

<pre><code>    my $ret = $logger-&gt;info(&quot;Message&quot;);</code></pre>

<p>will return <code>undef</code> if the system debug level for the current category is not <code>INFO</code> or more permissive. If Log::Log4perl forwarded the message to one or more appenders, the number of appenders is returned.</p>

<p>If appenders decide to veto on the message with an appender threshold, the log method&#39;s return value will have them excluded. This means that if you&#39;ve got one appender holding an appender threshold and you&#39;re logging a message which passes the system&#39;s log level hurdle but not the appender threshold, <code>0</code> will be returned by the log function.</p>

<p>The bottom line is: Logging functions will return a <i>true</i> value if the message made it through to one or more appenders and a <i>false</i> value if it didn&#39;t. This allows for constructs like</p>

<pre><code>    $logger-&gt;fatal(&quot;@_&quot;) or print STDERR &quot;@_\n&quot;;</code></pre>

<p>which will ensure that the fatal message isn&#39;t lost if the current level is lower than FATAL or printed twice if the level is acceptable but an appender already points to STDERR.</p>

<h2 id="Pitfalls-with-Categories"><a id="Pitfalls"></a>Pitfalls with Categories</h2>

<p>Be careful with just blindly reusing the system&#39;s packages as categories. If you do, you&#39;ll get into trouble with inherited methods. Imagine the following class setup:</p>

<pre><code>    use Log::Log4perl;

    ###########################################
    package Bar;
    ###########################################
    sub new {
        my($class) = @_;
        my $logger = Log::Log4perl::get_logger(__PACKAGE__);
        $logger-&gt;debug(&quot;Creating instance&quot;);
        bless {}, $class;
    }
    ###########################################
    package Bar::Twix;
    ###########################################
    our @ISA = qw(Bar);

    ###########################################
    package main;
    ###########################################
    Log::Log4perl-&gt;init(\ qq{
    log4perl.category.Bar.Twix = DEBUG, Screen
    log4perl.appender.Screen = Log::Log4perl::Appender::Screen
    log4perl.appender.Screen.layout = SimpleLayout
    });

    my $bar = Bar::Twix-&gt;new();</code></pre>

<p><code>Bar::Twix</code> just inherits everything from <code>Bar</code>, including the constructor <code>new()</code>. Contrary to what you might be thinking at first, this won&#39;t log anything. Reason for this is the <code>get_logger()</code> call in package <code>Bar</code>, which will always get a logger of the <code>Bar</code> category, even if we call <code>new()</code> via the <code>Bar::Twix</code> package, which will make perl go up the inheritance tree to actually execute <code>Bar::new()</code>. Since we&#39;ve only defined logging behaviour for <code>Bar::Twix</code> in the configuration file, nothing will happen.</p>

<p>This can be fixed by changing the <code>get_logger()</code> method in <code>Bar::new()</code> to obtain a logger of the category matching the <i>actual</i> class of the object, like in</p>

<pre><code>        # ... in Bar::new() ...
    my $logger = Log::Log4perl::get_logger( $class );</code></pre>

<p>In a method other than the constructor, the class name of the actual object can be obtained by calling <code>ref()</code> on the object reference, so</p>

<pre><code>    package BaseClass;
    use Log::Log4perl qw( get_logger );

    sub new { 
        bless {}, shift; 
    }

    sub method {
        my( $self ) = @_;

        get_logger( ref $self )-&gt;debug( &quot;message&quot; );
    }

    package SubClass;
    our @ISA = qw(BaseClass);</code></pre>

<p>is the recommended pattern to make sure that</p>

<pre><code>    my $sub = SubClass-&gt;new();
    $sub-&gt;meth();</code></pre>

<p>starts logging if the <code>&quot;SubClass&quot;</code> category (and not the <code>&quot;BaseClass&quot;</code> category has logging enabled at the DEBUG level.</p>

<h2 id="Initialize-once-and-only-once"><a id="Initialize1"></a>Initialize once and only once</h2>

<p>It&#39;s important to realize that Log::Log4perl gets initialized once and only once, typically at the start of a program or system. Calling <code>init()</code> more than once will cause it to clobber the existing configuration and <i>replace</i> it by the new one.</p>

<p>If you&#39;re in a traditional CGI environment, where every request is handled by a new process, calling <code>init()</code> every time is fine. In persistent environments like <code>mod_perl</code>, however, Log::Log4perl should be initialized either at system startup time (Apache offers startup handlers for that) or via</p>

<pre><code>        # Init or skip if already done
    Log::Log4perl-&gt;init_once($conf_file);</code></pre>

<p><code>init_once()</code> is identical to <code>init()</code>, just with the exception that it will leave a potentially existing configuration alone and will only call <code>init()</code> if Log::Log4perl hasn&#39;t been initialized yet.</p>

<p>If you&#39;re just curious if Log::Log4perl has been initialized yet, the check</p>

<pre><code>    if(Log::Log4perl-&gt;initialized()) {
        # Yes, Log::Log4perl has already been initialized
    } else {
        # No, not initialized yet ...
    }</code></pre>

<p>can be used.</p>

<p>If you&#39;re afraid that the components of your system are stepping on each other&#39;s toes or if you are thinking that different components should initialize Log::Log4perl separately, try to consolidate your system to use a centralized Log4perl configuration file and use Log4perl&#39;s <i>categories</i> to separate your components.</p>

<h2 id="Custom-Filters"><a id="Custom"></a>Custom Filters</h2>

<p>Log4perl allows the use of customized filters in its appenders to control the output of messages. These filters might grep for certain text chunks in a message, verify that its priority matches or exceeds a certain level or that this is the 10th time the same message has been submitted -- and come to a log/no log decision based upon these circumstantial facts.</p>

<p>Check out <a href="https://metacpan.org/pod/Log::Log4perl::Filter">Log::Log4perl::Filter</a> for detailed instructions on how to use them.</p>

<h2 id="Performance">Performance</h2>

<p>The performance of Log::Log4perl calls obviously depends on a lot of things. But to give you a general idea, here&#39;s some rough numbers:</p>

<p>On a Pentium 4 Linux box at 2.4 GHz, you&#39;ll get through</p>

<ul>

<li><p>500,000 suppressed log statements per second</p>

</li>
<li><p>30,000 logged messages per second (using an in-memory appender)</p>

</li>
<li><p>init_and_watch delay mode: 300,000 suppressed, 30,000 logged. init_and_watch signal mode: 450,000 suppressed, 30,000 logged.</p>

</li>
</ul>

<p>Numbers depend on the complexity of the Log::Log4perl configuration. For a more detailed benchmark test, check the <code>docs/benchmark.results.txt</code> document in the Log::Log4perl distribution.</p>

<h1 id="Cool-Tricks"><a id="Cool"></a>Cool Tricks</h1>

<p>Here&#39;s a collection of useful tricks for the advanced <code>Log::Log4perl</code> user. For more, check the FAQ, either in the distribution (<a href="https://metacpan.org/pod/distribution/Log-Log4perl/lib/Log/Log4perl/FAQ.pm">Log::Log4perl::FAQ</a>) or on <a href="http://log4perl.sourceforge.net">http://log4perl.sourceforge.net</a>.</p>

<h2 id="Shortcuts">Shortcuts</h2>

<p>When getting an instance of a logger, instead of saying</p>

<pre><code>    use Log::Log4perl;
    my $logger = Log::Log4perl-&gt;get_logger();</code></pre>

<p>it&#39;s often more convenient to import the <code>get_logger</code> method from <code>Log::Log4perl</code> into the current namespace:</p>

<pre><code>    use Log::Log4perl qw(get_logger);
    my $logger = get_logger();</code></pre>

<p>Please note this difference: To obtain the root logger, please use <code>get_logger(&quot;&quot;)</code>, call it without parameters (<code>get_logger()</code>), you&#39;ll get the logger of a category named after the current package. <code>get_logger()</code> is equivalent to <code>get_logger(__PACKAGE__)</code>.</p>

<h2 id="Alternative-initialization"><a id="Alternative"></a>Alternative initialization</h2>

<p>Instead of having <code>init()</code> read in a configuration file by specifying a file name or passing it a reference to an open filehandle (<code>Log::Log4perl-&gt;init( \*FILE )</code>), you can also pass in a reference to a string, containing the content of the file:</p>

<pre><code>    Log::Log4perl-&gt;init( \$config_text );</code></pre>

<p>Also, if you&#39;ve got the <code>name=value</code> pairs of the configuration in a hash, you can just as well initialize <code>Log::Log4perl</code> with a reference to it:</p>

<pre><code>    my %key_value_pairs = (
        &quot;log4perl.rootLogger&quot;       =&gt; &quot;ERROR, LOGFILE&quot;,
        &quot;log4perl.appender.LOGFILE&quot; =&gt; &quot;Log::Log4perl::Appender::File&quot;,
        ...
    );

    Log::Log4perl-&gt;init( \%key_value_pairs );</code></pre>

<p>Or also you can use a URL, see below:</p>

<h2 id="Using-LWP-to-parse-URLs"><a id="Using"></a>Using LWP to parse URLs</h2>

<p>(This section borrowed from XML::DOM::Parser by T.J. Mather).</p>

<p>The init() function now also supports URLs, e.g. <i>http://www.erols.com/enno/xsa.xml</i>. It uses LWP to download the file and then calls parse() on the resulting string. By default it will use a <a href="./LWP::UserAgent.html">LWP::UserAgent</a> that is created as follows:</p>

<pre><code> use LWP::UserAgent;
 $LWP_USER_AGENT = LWP::UserAgent-&gt;new;
 $LWP_USER_AGENT-&gt;env_proxy;</code></pre>

<p>Note that env_proxy reads proxy settings from environment variables, which is what Log4perl needs to do to get through our firewall. If you want to use a different LWP::UserAgent, you can set it with</p>

<pre><code>    Log::Log4perl::Config::set_LWP_UserAgent($my_agent);</code></pre>

<p>Currently, LWP is used when the filename (passed to parsefile) starts with one of the following URL schemes: http, https, ftp, wais, gopher, or file (followed by a colon.)</p>

<p>Don&#39;t use this feature with init_and_watch().</p>

<h2 id="Automatic-reloading-of-changed-configuration-files"><a id="Automatic"></a>Automatic reloading of changed configuration files</h2>

<p>Instead of just statically initializing Log::Log4perl via</p>

<pre><code>    Log::Log4perl-&gt;init($conf_file);</code></pre>

<p>there&#39;s a way to have Log::Log4perl periodically check for changes in the configuration and reload it if necessary:</p>

<pre><code>    Log::Log4perl-&gt;init_and_watch($conf_file, $delay);</code></pre>

<p>In this mode, Log::Log4perl will examine the configuration file <code>$conf_file</code> every <code>$delay</code> seconds for changes via the file&#39;s last modification timestamp. If the file has been updated, it will be reloaded and replace the current Log::Log4perl configuration.</p>

<p>The way this works is that with every logger function called (debug(), is_debug(), etc.), Log::Log4perl will check if the delay interval has expired. If so, it will run a -M file check on the configuration file. If its timestamp has been modified, the current configuration will be dumped and new content of the file will be loaded.</p>

<p>This convenience comes at a price, though: Calling time() with every logging function call, especially the ones that are &quot;suppressed&quot; (!), will slow down these Log4perl calls by about 40%.</p>

<p>To alleviate this performance hit a bit, <code>init_and_watch()</code> can be configured to listen for a Unix signal to reload the configuration instead:</p>

<pre><code>    Log::Log4perl-&gt;init_and_watch($conf_file, &#39;HUP&#39;);</code></pre>

<p>This will set up a signal handler for SIGHUP and reload the configuration if the application receives this signal, e.g. via the <code>kill</code> command:</p>

<pre><code>    kill -HUP pid</code></pre>

<p>where <code>pid</code> is the process ID of the application. This will bring you back to about 85% of Log::Log4perl&#39;s normal execution speed for suppressed statements. For details, check out <a href="./Log::Log4perl.html#Performance">&quot;Performance&quot;</a>. For more info on the signal handler, look for <a href="https://metacpan.org/pod/Log::Log4perl::Config::Watch#SIGNAL-MODE">&quot;SIGNAL MODE&quot; in Log::Log4perl::Config::Watch</a>.</p>

<p>If you have a somewhat long delay set between physical config file checks or don&#39;t want to use the signal associated with the config file watcher, you can trigger a configuration reload at the next possible time by calling <code>Log::Log4perl::Config-&gt;watcher-&gt;force_next_check()</code>.</p>

<p>One thing to watch out for: If the configuration file contains a syntax or other fatal error, a running application will stop with <code>die</code> if this damaged configuration will be loaded during runtime, triggered either by a signal or if the delay period expired and the change is detected. This behaviour might change in the future.</p>

<p>To allow the application to intercept and control a configuration reload in init_and_watch mode, a callback can be specified:</p>

<pre><code>    Log::Log4perl-&gt;init_and_watch($conf_file, 10, { 
            preinit_callback =&gt; \&amp;callback });</code></pre>

<p>If Log4perl determines that the configuration needs to be reloaded, it will call the <code>preinit_callback</code> function without parameters. If the callback returns a true value, Log4perl will proceed and reload the configuration. If the callback returns a false value, Log4perl will keep the old configuration and skip reloading it until the next time around. Inside the callback, an application can run all kinds of checks, including accessing the configuration file, which is available via <code>Log::Log4perl::Config-&gt;watcher()-&gt;file()</code>.</p>

<h2 id="Variable-Substitution"><a id="Variable"></a>Variable Substitution</h2>

<p>To avoid having to retype the same expressions over and over again, Log::Log4perl&#39;s configuration files support simple variable substitution. New variables are defined simply by adding</p>

<pre><code>    varname = value</code></pre>

<p>lines to the configuration file before using</p>

<pre><code>    ${varname}</code></pre>

<p>afterwards to recall the assigned values. Here&#39;s an example:</p>

<pre><code>    layout_class   = Log::Log4perl::Layout::PatternLayout
    layout_pattern = %d %F{1} %L&gt; %m %n
    
    log4perl.category.Bar.Twix = WARN, Logfile, Screen

    log4perl.appender.Logfile  = Log::Log4perl::Appender::File
    log4perl.appender.Logfile.filename = test.log
    log4perl.appender.Logfile.layout = ${layout_class}
    log4perl.appender.Logfile.layout.ConversionPattern = ${layout_pattern}

    log4perl.appender.Screen  = Log::Log4perl::Appender::Screen
    log4perl.appender.Screen.layout = ${layout_class}
    log4perl.appender.Screen.layout.ConversionPattern = ${layout_pattern}</code></pre>

<p>This is a convenient way to define two appenders with the same layout without having to retype the pattern definitions.</p>

<p>Variable substitution via <code>${varname}</code> will first try to find an explicitly defined variable. If that fails, it will check your shell&#39;s environment for a variable of that name. If that also fails, the program will <code>die()</code>.</p>

<h2 id="Perl-Hooks-in-the-Configuration-File"><a id="Perl"></a>Perl Hooks in the Configuration File</h2>

<p>If some of the values used in the Log4perl configuration file need to be dynamically modified by the program, use Perl hooks:</p>

<pre><code>    log4perl.appender.File.filename = \
        sub { return getLogfileName(); }</code></pre>

<p>Each value starting with the string <code>sub {...</code> is interpreted as Perl code to be executed at the time the application parses the configuration via <code>Log::Log4perl::init()</code>. The return value of the subroutine is used by Log::Log4perl as the configuration value.</p>

<p>The Perl code is executed in the <code>main</code> package, functions in other packages have to be called in fully-qualified notation.</p>

<p>Here&#39;s another example, utilizing an environment variable as a username for a DBI appender:</p>

<pre><code>    log4perl.appender.DB.username = \
        sub { $ENV{DB_USER_NAME } }</code></pre>

<p>However, please note the difference between these code snippets and those used for user-defined conversion specifiers as discussed in <a href="https://metacpan.org/pod/Log::Log4perl::Layout::PatternLayout">Log::Log4perl::Layout::PatternLayout</a>: While the snippets above are run <i>once</i> when <code>Log::Log4perl::init()</code> is called, the conversion specifier snippets are executed <i>each time</i> a message is rendered according to the PatternLayout.</p>

<p>SECURITY NOTE: this feature means arbitrary perl code can be embedded in the config file. In the rare case where the people who have access to your config file are different from the people who write your code and shouldn&#39;t have execute rights, you might want to set</p>

<pre><code>    Log::Log4perl::Config-&gt;allow_code(0);</code></pre>

<p>before you call init(). Alternatively you can supply a restricted set of Perl opcodes that can be embedded in the config file as described in <a href="./Log::Log4perl.html#Restricting-what-Opcodes-can-be-in-a-Perl-Hook">&quot;Restricting what Opcodes can be in a Perl Hook&quot;</a>.</p>

<h2 id="Restricting-what-Opcodes-can-be-in-a-Perl-Hook"><a id="Restricting"></a>Restricting what Opcodes can be in a Perl Hook</h2>

<p>The value you pass to Log::Log4perl::Config-&gt;allow_code() determines whether the code that is embedded in the config file is eval&#39;d unrestricted, or eval&#39;d in a Safe compartment. By default, a value of &#39;1&#39; is assumed, which does a normal &#39;eval&#39; without any restrictions. A value of &#39;0&#39; however prevents any embedded code from being evaluated.</p>

<p>If you would like fine-grained control over what can and cannot be included in embedded code, then please utilize the following methods:</p>

<pre><code> Log::Log4perl::Config-&gt;allow_code( $allow );
 Log::Log4perl::Config-&gt;allowed_code_ops($op1, $op2, ... );
 Log::Log4perl::Config-&gt;vars_shared_with_safe_compartment( [ \%vars | $package, \@vars ] );
 Log::Log4perl::Config-&gt;allowed_code_ops_convenience_map( [ \%map | $name, \@mask ] );</code></pre>

<p>Log::Log4perl::Config-&gt;allowed_code_ops() takes a list of opcode masks that are allowed to run in the compartment. The opcode masks must be specified as described in <a href="https://metacpan.org/pod/Opcode">Opcode</a>:</p>

<pre><code> Log::Log4perl::Config-&gt;allowed_code_ops(&#39;:subprocess&#39;);</code></pre>

<p>This example would allow Perl operations like backticks, system, fork, and waitpid to be executed in the compartment. Of course, you probably don&#39;t want to use this mask -- it would allow exactly what the Safe compartment is designed to prevent.</p>

<p>Log::Log4perl::Config-&gt;vars_shared_with_safe_compartment() takes the symbols which should be exported into the Safe compartment before the code is evaluated. The keys of this hash are the package names that the symbols are in, and the values are array references to the literal symbol names. For convenience, the default settings export the &#39;%ENV&#39; hash from the &#39;main&#39; package into the compartment:</p>

<pre><code> Log::Log4perl::Config-&gt;vars_shared_with_safe_compartment(
   main =&gt; [ &#39;%ENV&#39; ],
 );</code></pre>

<p>Log::Log4perl::Config-&gt;allowed_code_ops_convenience_map() is an accessor method to a map of convenience names to opcode masks. At present, the following convenience names are defined:</p>

<pre><code> safe        = [ &#39;:browse&#39; ]
 restrictive = [ &#39;:default&#39; ]</code></pre>

<p>For convenience, if Log::Log4perl::Config-&gt;allow_code() is called with a value which is a key of the map previously defined with Log::Log4perl::Config-&gt;allowed_code_ops_convenience_map(), then the allowed opcodes are set according to the value defined in the map. If this is confusing, consider the following:</p>

<pre><code> use Log::Log4perl;
 
 my $config = &lt;&lt;&#39;END&#39;;
  log4perl.logger = INFO, Main
  log4perl.appender.Main = Log::Log4perl::Appender::File
  log4perl.appender.Main.filename = \
      sub { &quot;example&quot; . getpwuid($&lt;) . &quot;.log&quot; }
  log4perl.appender.Main.layout = Log::Log4perl::Layout::SimpleLayout
 END
 
 $Log::Log4perl::Config-&gt;allow_code(&#39;restrictive&#39;);
 Log::Log4perl-&gt;init( \$config );       # will fail
 $Log::Log4perl::Config-&gt;allow_code(&#39;safe&#39;);
 Log::Log4perl-&gt;init( \$config );       # will succeed</code></pre>

<p>The reason that the first call to -&gt;init() fails is because the &#39;restrictive&#39; name maps to an opcode mask of &#39;:default&#39;. getpwuid() is not part of &#39;:default&#39;, so -&gt;init() fails. The &#39;safe&#39; name maps to an opcode mask of &#39;:browse&#39;, which allows getpwuid() to run, so -&gt;init() succeeds.</p>

<p>allowed_code_ops_convenience_map() can be invoked in several ways:</p>

<dl>

<dt id="allowed_code_ops_convenience_map()"><a id="allowed_code_ops_convenience_map"></a>allowed_code_ops_convenience_map()</dt>
<dd>

<p>Returns the entire convenience name map as a hash reference in scalar context or a hash in list context.</p>

</dd>
<dt id="allowed_code_ops_convenience_map(-\%map-)"><a id="allowed_code_ops_convenience_map1"></a><a id="allowed_code_ops_convenience_map---map"></a>allowed_code_ops_convenience_map( \%map )</dt>
<dd>

<p>Replaces the entire convenience name map with the supplied hash reference.</p>

</dd>
<dt id="allowed_code_ops_convenience_map(-$name-)"><a id="allowed_code_ops_convenience_map2"></a><a id="allowed_code_ops_convenience_map---name"></a>allowed_code_ops_convenience_map( $name )</dt>
<dd>

<p>Returns the opcode mask for the given convenience name, or undef if no such name is defined in the map.</p>

</dd>
<dt id="allowed_code_ops_convenience_map(-$name,-\@mask-)"><a id="allowed_code_ops_convenience_map3"></a><a id="allowed_code_ops_convenience_map---name---mask"></a>allowed_code_ops_convenience_map( $name, \@mask )</dt>
<dd>

<p>Adds the given name/mask pair to the convenience name map. If the name already exists in the map, it&#39;s value is replaced with the new mask.</p>

</dd>
</dl>

<p>as can vars_shared_with_safe_compartment():</p>

<dl>

<dt id="vars_shared_with_safe_compartment()"><a id="vars_shared_with_safe_compartment"></a>vars_shared_with_safe_compartment()</dt>
<dd>

<p>Return the entire map of packages to variables as a hash reference in scalar context or a hash in list context.</p>

</dd>
<dt id="vars_shared_with_safe_compartment(-\%packages-)"><a id="vars_shared_with_safe_compartment1"></a><a id="vars_shared_with_safe_compartment---packages"></a>vars_shared_with_safe_compartment( \%packages )</dt>
<dd>

<p>Replaces the entire map of packages to variables with the supplied hash reference.</p>

</dd>
<dt id="vars_shared_with_safe_compartment(-$package-)"><a id="vars_shared_with_safe_compartment2"></a><a id="vars_shared_with_safe_compartment---package"></a>vars_shared_with_safe_compartment( $package )</dt>
<dd>

<p>Returns the arrayref of variables to be shared for a specific package.</p>

</dd>
<dt id="vars_shared_with_safe_compartment(-$package,-\@vars-)"><a id="vars_shared_with_safe_compartment3"></a><a id="vars_shared_with_safe_compartment---package---vars"></a>vars_shared_with_safe_compartment( $package, \@vars )</dt>
<dd>

<p>Adds the given package / varlist pair to the map. If the package already exists in the map, it&#39;s value is replaced with the new arrayref of variable names.</p>

</dd>
</dl>

<p>For more information on opcodes and Safe Compartments, see <a href="https://metacpan.org/pod/Opcode">Opcode</a> and <a href="https://metacpan.org/pod/Safe">Safe</a>.</p>

<h2 id="Changing-the-Log-Level-on-a-Logger"><a id="Changing"></a>Changing the Log Level on a Logger</h2>

<p>Log4perl provides some internal functions for quickly adjusting the log level from within a running Perl program.</p>

<p>Now, some people might argue that you should adjust your levels from within an external Log4perl configuration file, but Log4perl is everybody&#39;s darling.</p>

<p>Typically run-time adjusting of levels is done at the beginning, or in response to some external input (like a &quot;more logging&quot; runtime command for diagnostics).</p>

<p>You get the log level from a logger object with:</p>

<pre><code>    $current_level = $logger-&gt;level();</code></pre>

<p>and you may set it with the same method, provided you first imported the log level constants, with:</p>

<pre><code>    use Log::Log4perl::Level;</code></pre>

<p>Then you can set the level on a logger to one of the constants,</p>

<pre><code>    $logger-&gt;level($ERROR); # one of DEBUG, INFO, WARN, ERROR, FATAL</code></pre>

<p>To <b>increase</b> the level of logging currently being done, use:</p>

<pre><code>    $logger-&gt;more_logging($delta);</code></pre>

<p>and to <b>decrease</b> it, use:</p>

<pre><code>    $logger-&gt;less_logging($delta);</code></pre>

<p>$delta must be a positive integer (for now, we may fix this later ;).</p>

<p>There are also two equivalent functions:</p>

<pre><code>    $logger-&gt;inc_level($delta);
    $logger-&gt;dec_level($delta);</code></pre>

<p>They&#39;re included to allow you a choice in readability. Some folks will prefer more/less_logging, as they&#39;re fairly clear in what they do, and allow the programmer not to worry too much about what a Level is and whether a higher level means more or less logging. However, other folks who do understand and have lots of code that deals with levels will probably prefer the inc_level() and dec_level() methods as they want to work with Levels and not worry about whether that means more or less logging. :)</p>

<p>That diatribe aside, typically you&#39;ll use more_logging() or inc_level() as such:</p>

<pre><code>    my $v = 0; # default level of verbosity.
    
    GetOptions(&quot;v+&quot; =&gt; \$v, ...);

    if( $v ) {
      $logger-&gt;more_logging($v); # inc logging level once for each -v in ARGV
    }</code></pre>

<h2 id="Custom-Log-Levels"><a id="Custom1"></a>Custom Log Levels</h2>

<p>First off, let me tell you that creating custom levels is heavily deprecated by the log4j folks. Indeed, instead of creating additional levels on top of the predefined DEBUG, INFO, WARN, ERROR and FATAL, you should use categories to control the amount of logging smartly, based on the location of the log-active code in the system.</p>

<p>Nevertheless, Log4perl provides a nice way to create custom levels via the create_custom_level() routine function. However, this must be done before the first call to init() or get_logger(). Say you want to create a NOTIFY logging level that comes after WARN (and thus before INFO). You&#39;d do such as follows:</p>

<pre><code>    use Log::Log4perl;
    use Log::Log4perl::Level;

    Log::Log4perl::Logger::create_custom_level(&quot;NOTIFY&quot;, &quot;WARN&quot;);</code></pre>

<p>And that&#39;s it! <code>create_custom_level()</code> creates the following functions / variables for level FOO:</p>

<pre><code>    $FOO_INT        # integer to use in L4p::Level::to_level()
    $logger-&gt;foo()  # log function to log if level = FOO
    $logger-&gt;is_foo()   # true if current level is &gt;= FOO</code></pre>

<p>These levels can also be used in your config file, but note that your config file probably won&#39;t be portable to another log4perl or log4j environment unless you&#39;ve made the appropriate mods there too.</p>

<p>Since Log4perl translates log levels to syslog and Log::Dispatch if their appenders are used, you may add mappings for custom levels as well:</p>

<pre><code>  Log::Log4perl::Level::add_priority(&quot;NOTIFY&quot;, &quot;WARN&quot;,
                                     $syslog_equiv, $log_dispatch_level);</code></pre>

<p>For example, if your new custom &quot;NOTIFY&quot; level is supposed to map to syslog level 2 (&quot;LOG_NOTICE&quot;) and Log::Dispatch level 2 (&quot;notice&quot;), use:</p>

<pre><code>  Log::Log4perl::Logger::create_custom_level(&quot;NOTIFY&quot;, &quot;WARN&quot;, 2, 2);</code></pre>

<h2 id="System-wide-log-levels"><a id="System"></a>System-wide log levels</h2>

<p>As a fairly drastic measure to decrease (or increase) the logging level all over the system with one single configuration option, use the <code>threshold</code> keyword in the Log4perl configuration file:</p>

<pre><code>    log4perl.threshold = ERROR</code></pre>

<p>sets the system-wide (or hierarchy-wide according to the log4j documentation) to ERROR and therefore deprives every logger in the system of the right to log lower-prio messages.</p>

<h2 id="Easy-Mode"><a id="Easy"></a>Easy Mode</h2>

<p>For teaching purposes (especially for [1]), I&#39;ve put <code>:easy</code> mode into <code>Log::Log4perl</code>, which just initializes a single root logger with a defined priority and a screen appender including some nice standard layout:</p>

<pre><code>    ### Initialization Section
    use Log::Log4perl qw(:easy);
    Log::Log4perl-&gt;easy_init($ERROR);  # Set priority of root logger to ERROR

    ### Application Section
    my $logger = get_logger();
    $logger-&gt;fatal(&quot;This will get logged.&quot;);
    $logger-&gt;debug(&quot;This won&#39;t.&quot;);</code></pre>

<p>This will dump something like</p>

<pre><code>    2002/08/04 11:43:09 ERROR&gt; script.pl:16 main::function - This will get logged.</code></pre>

<p>to the screen. While this has been proven to work well familiarizing people with <code>Log::Logperl</code> slowly, effectively avoiding to clobber them over the head with a plethora of different knobs to fiddle with (categories, appenders, levels, layout), the overall mission of <code>Log::Log4perl</code> is to let people use categories right from the start to get used to the concept. So, let&#39;s keep this one fairly hidden in the man page (congrats on reading this far :).</p>

<h2 id="Stealth-loggers"><a id="Stealth"></a>Stealth loggers</h2>

<p>Sometimes, people are lazy. If you&#39;re whipping up a 50-line script and want the comfort of Log::Log4perl without having the burden of carrying a separate log4perl.conf file or a 5-liner defining that you want to append your log statements to a file, you can use the following features:</p>

<pre><code>    use Log::Log4perl qw(:easy);

    Log::Log4perl-&gt;easy_init( { level   =&gt; $DEBUG,
                                file    =&gt; &quot;&gt;&gt;test.log&quot; } );

        # Logs to test.log via stealth logger
    DEBUG(&quot;Debug this!&quot;);
    INFO(&quot;Info this!&quot;);
    WARN(&quot;Warn this!&quot;);
    ERROR(&quot;Error this!&quot;);

    some_function();

    sub some_function {
            # Same here
        FATAL(&quot;Fatal this!&quot;);
    }</code></pre>

<p>In <code>:easy</code> mode, <code>Log::Log4perl</code> will instantiate a <i>stealth logger</i> and introduce the convenience functions <code>TRACE</code>, <code>DEBUG()</code>, <code>INFO()</code>, <code>WARN()</code>, <code>ERROR()</code>, <code>FATAL()</code>, and <code>ALWAYS</code> into the package namespace. These functions simply take messages as arguments and forward them to the stealth loggers methods (<code>debug()</code>, <code>info()</code>, and so on).</p>

<p>If a message should never be blocked, regardless of the log level, use the <code>ALWAYS</code> function which corresponds to a log level of <code>OFF</code>:</p>

<pre><code>    ALWAYS &quot;This will be printed regardless of the log level&quot;;</code></pre>

<p>The <code>easy_init</code> method can be called with a single level value to create a STDERR appender and a root logger as in</p>

<pre><code>    Log::Log4perl-&gt;easy_init($DEBUG);</code></pre>

<p>or, as shown below (and in the example above) with a reference to a hash, specifying values for <code>level</code> (the logger&#39;s priority), <code>file</code> (the appender&#39;s data sink), <code>category</code> (the logger&#39;s category and <code>layout</code> for the appender&#39;s pattern layout specification. All key-value pairs are optional, they default to <code>$DEBUG</code> for <code>level</code>, <code>STDERR</code> for <code>file</code>, <code>&quot;&quot;</code> (root category) for <code>category</code> and <code>%d %m%n</code> for <code>layout</code>:</p>

<pre><code>    Log::Log4perl-&gt;easy_init( { level    =&gt; $DEBUG,
                                file     =&gt; &quot;&gt;test.log&quot;,
                                utf8     =&gt; 1,
                                category =&gt; &quot;Bar::Twix&quot;,
                                layout   =&gt; &#39;%F{1}-%L-%M: %m%n&#39; } );</code></pre>

<p>The <code>file</code> parameter takes file names preceded by <code>&quot;&gt;&quot;</code> (overwrite) and <code>&quot;&gt;&gt;&quot;</code> (append) as arguments. This will cause <code>Log::Log4perl::Appender::File</code> appenders to be created behind the scenes. Also the keywords <code>STDOUT</code> and <code>STDERR</code> (no <code>&gt;</code> or <code>&gt;&gt;</code>) are recognized, which will utilize and configure <code>Log::Log4perl::Appender::Screen</code> appropriately. The <code>utf8</code> flag, if set to a true value, runs a <code>binmode</code> command on the file handle to establish a utf8 line discipline on the file, otherwise you&#39;ll get a &#39;wide character in print&#39; warning message and probably not what you&#39;d expect as output.</p>

<p>The stealth loggers can be used in different packages, you just need to make sure you&#39;re calling the &quot;use&quot; function in every package you&#39;re using <code>Log::Log4perl</code>&#39;s easy services:</p>

<pre><code>    package Bar::Twix;
    use Log::Log4perl qw(:easy);
    sub eat { DEBUG(&quot;Twix mjam&quot;); }

    package Bar::Mars;
    use Log::Log4perl qw(:easy);
    sub eat { INFO(&quot;Mars mjam&quot;); }

    package main;

    use Log::Log4perl qw(:easy);

    Log::Log4perl-&gt;easy_init( { level    =&gt; $DEBUG,
                                file     =&gt; &quot;&gt;&gt;test.log&quot;,
                                category =&gt; &quot;Bar::Twix&quot;,
                                layout   =&gt; &#39;%F{1}-%L-%M: %m%n&#39; },
                              { level    =&gt; $DEBUG,
                                file     =&gt; &quot;STDOUT&quot;,
                                category =&gt; &quot;Bar::Mars&quot;,
                                layout   =&gt; &#39;%m%n&#39; },
                            );
    Bar::Twix::eat();
    Bar::Mars::eat();</code></pre>

<p>As shown above, <code>easy_init()</code> will take any number of different logger definitions as hash references.</p>

<p>Also, stealth loggers feature the functions <code>LOGWARN()</code>, <code>LOGDIE()</code>, and <code>LOGEXIT()</code>, combining a logging request with a subsequent Perl warn() or die() or exit() statement. So, for example</p>

<pre><code>    if($all_is_lost) {
        LOGDIE(&quot;Terrible Problem&quot;);
    }</code></pre>

<p>will log the message if the package&#39;s logger is at least <code>FATAL</code> but <code>die()</code> (including the traditional output to STDERR) in any case afterwards.</p>

<p>See <a href="./Log::Log4perl.html#Log-and-die-or-warn">&quot;Log and die or warn&quot;</a> for the similar <code>logdie()</code> and <code>logwarn()</code> functions of regular (i.e non-stealth) loggers.</p>

<p>Similarily, <code>LOGCARP()</code>, <code>LOGCLUCK()</code>, <code>LOGCROAK()</code>, and <code>LOGCONFESS()</code> are provided in <code>:easy</code> mode, facilitating the use of <code>logcarp()</code>, <code>logcluck()</code>, <code>logcroak()</code>, and <code>logconfess()</code> with stealth loggers.</p>

<p><b>When using Log::Log4perl in easy mode, please make sure you understand the implications of <a href="./Log::Log4perl.html#Pitfalls-with-Categories">&quot;Pitfalls with Categories&quot;</a></b>.</p>

<p>By the way, these convenience functions perform exactly as fast as the standard Log::Log4perl logger methods, there&#39;s <i>no</i> performance penalty whatsoever.</p>

<h2 id="Nested-Diagnostic-Context-(NDC)"><a id="Nested"></a><a id="Nested-Diagnostic-Context--NDC"></a>Nested Diagnostic Context (NDC)</h2>

<p>If you find that your application could use a global (thread-specific) data stack which your loggers throughout the system have easy access to, use Nested Diagnostic Contexts (NDCs). Also check out <a href="./Log::Log4perl.html#Mapped-Diagnostic-Context-(MDC)">&quot;Mapped Diagnostic Context (MDC)&quot;</a>, this might turn out to be even more useful.</p>

<p>For example, when handling a request of a web client, it&#39;s probably useful to have the user&#39;s IP address available in all log statements within code dealing with this particular request. Instead of passing this piece of data around between your application functions, you can just use the global (but thread-specific) NDC mechanism. It allows you to push data pieces (scalars usually) onto its stack via</p>

<pre><code>    Log::Log4perl::NDC-&gt;push(&quot;San&quot;);
    Log::Log4perl::NDC-&gt;push(&quot;Francisco&quot;);</code></pre>

<p>and have your loggers retrieve them again via the &quot;%x&quot; placeholder in the PatternLayout. With the stack values above and a PatternLayout format like &quot;%x %m%n&quot;, the call</p>

<pre><code>    $logger-&gt;debug(&quot;rocks&quot;);</code></pre>

<p>will end up as</p>

<pre><code>    San Francisco rocks</code></pre>

<p>in the log appender.</p>

<p>The stack mechanism allows for nested structures. Just make sure that at the end of the request, you either decrease the stack one by one by calling</p>

<pre><code>    Log::Log4perl::NDC-&gt;pop();
    Log::Log4perl::NDC-&gt;pop();</code></pre>

<p>or clear out the entire NDC stack by calling</p>

<pre><code>    Log::Log4perl::NDC-&gt;remove();</code></pre>

<p>Even if you should forget to do that, <code>Log::Log4perl</code> won&#39;t grow the stack indefinitely, but limit it to a maximum, defined in <code>Log::Log4perl::NDC</code> (currently 5). A call to <code>push()</code> on a full stack will just replace the topmost element by the new value.</p>

<p>Again, the stack is always available via the &quot;%x&quot; placeholder in the Log::Log4perl::Layout::PatternLayout class whenever a logger fires. It will replace &quot;%x&quot; by the blank-separated list of the values on the stack. It does that by just calling</p>

<pre><code>    Log::Log4perl::NDC-&gt;get();</code></pre>

<p>internally. See details on how this standard log4j feature is implemented in <a href="https://metacpan.org/pod/Log::Log4perl::NDC">Log::Log4perl::NDC</a>.</p>

<h2 id="Mapped-Diagnostic-Context-(MDC)"><a id="Mapped"></a><a id="Mapped-Diagnostic-Context--MDC"></a>Mapped Diagnostic Context (MDC)</h2>

<p>Just like the previously discussed NDC stores thread-specific information in a stack structure, the MDC implements a hash table to store key/value pairs in.</p>

<p>The static method</p>

<pre><code>    Log::Log4perl::MDC-&gt;put($key, $value);</code></pre>

<p>stores <code>$value</code> under a key <code>$key</code>, with which it can be retrieved later (possibly in a totally different part of the system) by calling the <code>get</code> method:</p>

<pre><code>    my $value = Log::Log4perl::MDC-&gt;get($key);</code></pre>

<p>If no value has been stored previously under <code>$key</code>, the <code>get</code> method will return <code>undef</code>.</p>

<p>Typically, MDC values are retrieved later on via the <code>&quot;%X{...}&quot;</code> placeholder in <code>Log::Log4perl::Layout::PatternLayout</code>. If the <code>get()</code> method returns <code>undef</code>, the placeholder will expand to the string <code>[undef]</code>.</p>

<p>An application taking a web request might store the remote host like</p>

<pre><code>    Log::Log4perl::MDC-&gt;put(&quot;remote_host&quot;, $r-&gt;headers(&quot;HOST&quot;));</code></pre>

<p>at its beginning and if the appender&#39;s layout looks something like</p>

<pre><code>    log4perl.appender.Logfile.layout.ConversionPattern = %X{remote_host}: %m%n</code></pre>

<p>then a log statement like</p>

<pre><code>   DEBUG(&quot;Content delivered&quot;);</code></pre>

<p>will log something like</p>

<pre><code>   adsl-63.dsl.snf.pacbell.net: Content delivered </code></pre>

<p>later on in the program.</p>

<p>For details, please check <a href="https://metacpan.org/pod/Log::Log4perl::MDC">Log::Log4perl::MDC</a>.</p>

<h2 id="Resurrecting-hidden-Log4perl-Statements"><a id="Resurrecting"></a>Resurrecting hidden Log4perl Statements</h2>

<p>Sometimes scripts need to be deployed in environments without having Log::Log4perl installed yet. On the other hand, you don&#39;t want to live without your Log4perl statements -- they&#39;re gonna come in handy later.</p>

<p>So, just deploy your script with Log4perl statements commented out with the pattern <code>###l4p</code>, like in</p>

<pre><code>    ###l4p DEBUG &quot;It works!&quot;;
    # ...
    ###l4p INFO &quot;Really!&quot;;</code></pre>

<p>If Log::Log4perl is available, use the <code>:resurrect</code> tag to have Log4perl resurrect those buried statements before the script starts running:</p>

<pre><code>    use Log::Log4perl qw(:resurrect :easy);

    ###l4p Log::Log4perl-&gt;easy_init($DEBUG);
    ###l4p DEBUG &quot;It works!&quot;;
    # ...
    ###l4p INFO &quot;Really!&quot;;</code></pre>

<p>This will have a source filter kick in and indeed print</p>

<pre><code>    2004/11/18 22:08:46 It works!
    2004/11/18 22:08:46 Really!</code></pre>

<p>In environments lacking Log::Log4perl, just comment out the first line and the script will run nevertheless (but of course without logging):</p>

<pre><code>    # use Log::Log4perl qw(:resurrect :easy);

    ###l4p Log::Log4perl-&gt;easy_init($DEBUG);
    ###l4p DEBUG &quot;It works!&quot;;
    # ...
    ###l4p INFO &quot;Really!&quot;;</code></pre>

<p>because everything&#39;s a regular comment now. Alternatively, put the magic Log::Log4perl comment resurrection line into your shell&#39;s PERL5OPT environment variable, e.g. for bash:</p>

<pre><code>    set PERL5OPT=-MLog::Log4perl=:resurrect,:easy
    export PERL5OPT</code></pre>

<p>This will awaken the giant within an otherwise silent script like the following:</p>

<pre><code>    #!/usr/bin/perl

    ###l4p Log::Log4perl-&gt;easy_init($DEBUG);
    ###l4p DEBUG &quot;It works!&quot;;</code></pre>

<p>As of <code>Log::Log4perl</code> 1.12, you can even force <i>all</i> modules loaded by a script to have their hidden Log4perl statements resurrected. For this to happen, load <code>Log::Log4perl::Resurrector</code> <i>before</i> loading any modules:</p>

<pre><code>    use Log::Log4perl qw(:easy);
    use Log::Log4perl::Resurrector;

    use Foobar; # All hidden Log4perl statements in here will
                # be uncommented before Foobar gets loaded.

    Log::Log4perl-&gt;easy_init($DEBUG);
    ...</code></pre>

<p>Check the <code>Log::Log4perl::Resurrector</code> manpage for more details.</p>

<h2 id="Access-defined-appenders"><a id="Access"></a>Access defined appenders</h2>

<p>All appenders defined in the configuration file or via Perl code can be retrieved by the <code>appender_by_name()</code> class method. This comes in handy if you want to manipulate or query appender properties after the Log4perl configuration has been loaded via <code>init()</code>.</p>

<p>Note that internally, Log::Log4perl uses the <code>Log::Log4perl::Appender</code> wrapper class to control the real appenders (like <code>Log::Log4perl::Appender::File</code> or <code>Log::Dispatch::FileRotate</code>). The <code>Log::Log4perl::Appender</code> class has an <code>appender</code> attribute, pointing to the real appender.</p>

<p>The reason for this is that external appenders like <code>Log::Dispatch::FileRotate</code> don&#39;t support all of Log::Log4perl&#39;s appender control mechanisms (like appender thresholds).</p>

<p>The previously mentioned method <code>appender_by_name()</code> returns a reference to the <i>real</i> appender object. If you want access to the wrapper class (e.g. if you want to modify the appender&#39;s threshold), use the hash <code>$Log::Log4perl::Logger::APPENDER_BY_NAME{...}</code> instead, which holds references to all appender wrapper objects.</p>

<h2 id="Modify-appender-thresholds"><a id="Modify"></a>Modify appender thresholds</h2>

<p>To set an appender&#39;s threshold, use its <code>threshold()</code> method:</p>

<pre><code>    $app-&gt;threshold( $FATAL );</code></pre>

<p>To conveniently adjust <i>all</i> appender thresholds (e.g. because a script uses more_logging()), use</p>

<pre><code>       # decrease thresholds of all appenders
    Log::Log4perl-&gt;appender_thresholds_adjust(-1);</code></pre>

<p>This will decrease the thresholds of all appenders in the system by one level, i.e. WARN becomes INFO, INFO becomes DEBUG, etc. To only modify selected ones, use</p>

<pre><code>       # decrease thresholds of selected appenders
    Log::Log4perl-&gt;appender_thresholds_adjust(-1, [&#39;AppName1&#39;, ...]);</code></pre>

<p>and pass the names of affected appenders in a ref to an array.</p>

<h1 id="Advanced-configuration-within-Perl"><a id="Advanced"></a>Advanced configuration within Perl</h1>

<p>Initializing Log::Log4perl can certainly also be done from within Perl. At last, this is what <code>Log::Log4perl::Config</code> does behind the scenes. Log::Log4perl&#39;s configuration file parsers are using a publically available API to set up Log::Log4perl&#39;s categories, appenders and layouts.</p>

<p>Here&#39;s an example on how to configure two appenders with the same layout in Perl, without using a configuration file at all:</p>

<pre><code>  ########################
  # Initialization section
  ########################
  use Log::Log4perl;
  use Log::Log4perl::Layout;
  use Log::Log4perl::Level;

     # Define a category logger
  my $log = Log::Log4perl-&gt;get_logger(&quot;Foo::Bar&quot;);

     # Define a layout
  my $layout = Log::Log4perl::Layout::PatternLayout-&gt;new(&quot;[%r] %F %L %m%n&quot;);

     # Define a file appender
  my $file_appender = Log::Log4perl::Appender-&gt;new(
                          &quot;Log::Log4perl::Appender::File&quot;,
                          name      =&gt; &quot;filelog&quot;,
                          filename  =&gt; &quot;/tmp/my.log&quot;);

     # Define a stdout appender
  my $stdout_appender =  Log::Log4perl::Appender-&gt;new(
                          &quot;Log::Log4perl::Appender::Screen&quot;,
                          name      =&gt; &quot;screenlog&quot;,
                          stderr    =&gt; 0);

     # Define a mixed stderr/stdout appender
  my $mixed_stdout_stderr_appender = Log::Log4perl::Appender-&gt;new(
                          &quot;Log::Log4perl::Appender::Screen&quot;,
                          name      =&gt; &quot;screenlog&quot;,
                          stderr    =&gt; { ERROR =&gt; 1, FATAL =&gt; 1 });

     # Have both appenders use the same layout (could be different)
  $stdout_appender-&gt;layout($layout);
  $file_appender-&gt;layout($layout);

  $log-&gt;add_appender($stdout_appender);
  $log-&gt;add_appender($file_appender);
  $log-&gt;level($INFO);</code></pre>

<p>Please note the class of the appender object is passed as a <i>string</i> to <code>Log::Log4perl::Appender</code> in the <i>first</i> argument. Behind the scenes, <code>Log::Log4perl::Appender</code> will create the necessary <code>Log::Log4perl::Appender::*</code> (or <code>Log::Dispatch::*</code>) object and pass along the name value pairs we provided to <code>Log::Log4perl::Appender-&gt;new()</code> after the first argument.</p>

<p>The <code>name</code> value is optional and if you don&#39;t provide one, <code>Log::Log4perl::Appender-&gt;new()</code> will create a unique one for you. The names and values of additional parameters are dependent on the requirements of the particular appender class and can be looked up in their manual pages.</p>

<p>A side note: In case you&#39;re wondering if <code>Log::Log4perl::Appender-&gt;new()</code> will also take care of the <code>min_level</code> argument to the <code>Log::Dispatch::*</code> constructors called behind the scenes -- yes, it does. This is because we want the <code>Log::Dispatch</code> objects to blindly log everything we send them (<code>debug</code> is their lowest setting) because <i>we</i> in <code>Log::Log4perl</code> want to call the shots and decide on when and what to log.</p>

<p>The call to the appender&#39;s <i>layout()</i> method specifies the format (as a previously created <code>Log::Log4perl::Layout::PatternLayout</code> object) in which the message is being logged in the specified appender. If you don&#39;t specify a layout, the logger will fall back to <code>Log::Log4perl::SimpleLayout</code>, which logs the debug level, a hyphen (-) and the log message.</p>

<p>Layouts are objects, here&#39;s how you create them:</p>

<pre><code>        # Create a simple layout
    my $simple = Log::Log4perl::SimpleLayout();

        # create a flexible layout:
        # (&quot;yyyy/MM/dd hh:mm:ss (file:lineno)&gt; message\n&quot;)
    my $pattern = Log::Log4perl::Layout::PatternLayout(&quot;%d (%F:%L)&gt; %m%n&quot;);</code></pre>

<p>Every appender has exactly one layout assigned to it. You assign the layout to the appender using the appender&#39;s <code>layout()</code> object:</p>

<pre><code>    my $app =  Log::Log4perl::Appender-&gt;new(
                  &quot;Log::Log4perl::Appender::Screen&quot;,
                  name      =&gt; &quot;screenlog&quot;,
                  stderr    =&gt; 0);

        # Assign the previously defined flexible layout
    $app-&gt;layout($pattern);

        # Add the appender to a previously defined logger
    $logger-&gt;add_appender($app);

        # ... and you&#39;re good to go!
    $logger-&gt;debug(&quot;Blah&quot;);
        # =&gt; &quot;2002/07/10 23:55:35 (test.pl:207)&gt; Blah\n&quot;</code></pre>

<p>It&#39;s also possible to remove appenders from a logger:</p>

<pre><code>    $logger-&gt;remove_appender($appender_name);</code></pre>

<p>will remove an appender, specified by name, from a given logger. Please note that this does <i>not</i> remove an appender from the system.</p>

<p>To eradicate an appender from the system, you need to call <code>Log::Log4perl-&gt;eradicate_appender($appender_name)</code> which will first remove the appender from every logger in the system and then will delete all references Log4perl holds to it.</p>

<p>To remove a logger from the system, use <code>Log::Log4perl-&gt;remove_logger($logger)</code>. After the remaining reference <code>$logger</code> goes away, the logger will self-destruct. If the logger in question is a stealth logger, all of its convenience shortcuts (DEBUG, INFO, etc) will turn into no-ops.</p>

<h1 id="How-about-Log::Dispatch::Config?"><a id="How1"></a><a id="How-about-Log::Dispatch::Config"></a>How about Log::Dispatch::Config?</h1>

<p>Tatsuhiko Miyagawa&#39;s <code>Log::Dispatch::Config</code> is a very clever simplified logger implementation, covering some of the <i>log4j</i> functionality. Among the things that <code>Log::Log4perl</code> can but <code>Log::Dispatch::Config</code> can&#39;t are:</p>

<ul>

<li><p>You can&#39;t assign categories to loggers. For small systems that&#39;s fine, but if you can&#39;t turn off and on detailed logging in only a tiny subsystem of your environment, you&#39;re missing out on a majorly useful log4j feature.</p>

</li>
<li><p>Defining appender thresholds. Important if you want to solve problems like &quot;log all messages of level FATAL to STDERR, plus log all DEBUG messages in <code>Foo::Bar</code> to a log file&quot;. If you don&#39;t have appenders thresholds, there&#39;s no way to prevent cluttering STDERR with DEBUG messages.</p>

</li>
<li><p>PatternLayout specifications in accordance with the standard (e.g. &quot;%d{HH:mm}&quot;).</p>

</li>
</ul>

<p>Bottom line: Log::Dispatch::Config is fine for small systems with simple logging requirements. However, if you&#39;re designing a system with lots of subsystems which you need to control independently, you&#39;ll love the features of <code>Log::Log4perl</code>, which is equally easy to use.</p>

<h1 id="Using-Log::Log4perl-with-wrapper-functions-and-classes"><a id="Using1"></a>Using Log::Log4perl with wrapper functions and classes</h1>

<p>If you don&#39;t use <code>Log::Log4perl</code> as described above, but from a wrapper function, the pattern layout will generate wrong data for %F, %C, %L, and the like. Reason for this is that <code>Log::Log4perl</code>&#39;s loggers assume a static caller depth to the application that&#39;s using them.</p>

<p>If you&#39;re using one (or more) wrapper functions, <code>Log::Log4perl</code> will indicate where your logger function called the loggers, not where your application called your wrapper:</p>

<pre><code>    use Log::Log4perl qw(:easy);
    Log::Log4perl-&gt;easy_init({ level =&gt; $DEBUG, 
                               layout =&gt; &quot;%M %m%n&quot; });

    sub mylog {
        my($message) = @_;

        DEBUG $message;
    }

    sub func {
        mylog &quot;Hello&quot;;
    }

    func();</code></pre>

<p>prints</p>

<pre><code>    main::mylog Hello</code></pre>

<p>but that&#39;s probably not what your application expects. Rather, you&#39;d want</p>

<pre><code>    main::func Hello</code></pre>

<p>because the <code>func</code> function called your logging function.</p>

<p>But don&#39;t despair, there&#39;s a solution: Just register your wrapper package with Log4perl beforehand. If Log4perl then finds that it&#39;s being called from a registered wrapper, it will automatically step up to the next call frame.</p>

<pre><code>    Log::Log4perl-&gt;wrapper_register(__PACKAGE__);

    sub mylog {
        my($message) = @_;

        DEBUG $message;
    }</code></pre>

<p>Alternatively, you can increase the value of the global variable <code>$Log::Log4perl::caller_depth</code> (defaults to 0) by one for every wrapper that&#39;s in between your application and <code>Log::Log4perl</code>, then <code>Log::Log4perl</code> will compensate for the difference:</p>

<pre><code>    sub mylog {
        my($message) = @_;

        local $Log::Log4perl::caller_depth =
              $Log::Log4perl::caller_depth + 1;
        DEBUG $message;
    }</code></pre>

<p>Also, note that if you&#39;re writing a subclass of Log4perl, like</p>

<pre><code>    package MyL4pWrapper;
    use Log::Log4perl;
    our @ISA = qw(Log::Log4perl);</code></pre>

<p>and you want to call get_logger() in your code, like</p>

<pre><code>    use MyL4pWrapper;

    sub get_logger {
        my $logger = Log::Log4perl-&gt;get_logger();
    }</code></pre>

<p>then the get_logger() call will get a logger for the <code>MyL4pWrapper</code> category, not for the package calling the wrapper class as in</p>

<pre><code>    package UserPackage;
    my $logger = MyL4pWrapper-&gt;get_logger();</code></pre>

<p>To have the above call to get_logger return a logger for the &quot;UserPackage&quot; category, you need to tell Log4perl that &quot;MyL4pWrapper&quot; is a Log4perl wrapper class:</p>

<pre><code>    use MyL4pWrapper;
    Log::Log4perl-&gt;wrapper_register(__PACKAGE__);

    sub get_logger {
          # Now gets a logger for the category of the calling package
        my $logger = Log::Log4perl-&gt;get_logger();
    }</code></pre>

<p>This feature works both for Log4perl-relaying classes like the wrapper described above, and for wrappers that inherit from Log4perl use Log4perl&#39;s get_logger function via inheritance, alike.</p>

<h1 id="Access-to-Internals"><a id="Access1"></a>Access to Internals</h1>

<p>The following methods are only of use if you want to peek/poke in the internals of Log::Log4perl. Be careful not to disrupt its inner workings.</p>

<dl>

<dt id="Log::Log4perl-&gt;appenders()"><a id="Log5"></a><a id="Log::Log4perl--appenders"></a><code>Log::Log4perl-&gt;appenders()</code></dt>
<dd>

<p>To find out which appenders are currently defined (not only for a particular logger, but overall), a <code>appenders()</code> method is available to return a reference to a hash mapping appender names to their Log::Log4perl::Appender object references.</p>

</dd>
</dl>

<h1 id="Dirty-Tricks"><a id="Dirty"></a>Dirty Tricks</h1>

<dl>

<dt id="infiltrate_lwp()"><a id="infiltrate_lwp"></a>infiltrate_lwp()</dt>
<dd>

<p>The famous LWP::UserAgent module isn&#39;t Log::Log4perl-enabled. Often, though, especially when tracing Web-related problems, it would be helpful to get some insight on what&#39;s happening inside LWP::UserAgent. Ideally, LWP::UserAgent would even play along in the Log::Log4perl framework.</p>

<p>A call to <code>Log::Log4perl-&gt;infiltrate_lwp()</code> does exactly this. In a very rude way, it pulls the rug from under LWP::UserAgent and transforms its <code>debug/conn</code> messages into <code>debug()</code> calls of loggers of the category <code>&quot;LWP::UserAgent&quot;</code>. Similarily, <code>LWP::UserAgent</code>&#39;s <code>trace</code> messages are turned into <code>Log::Log4perl</code>&#39;s <code>info()</code> method calls. Note that this only works for LWP::UserAgent versions &lt; 5.822, because this (and probably later) versions miss debugging functions entirely.</p>

</dd>
<dt id="Suppressing-&#39;duplicate&#39;-LOGDIE-messages"><a id="Suppressing"></a><a id="Suppressing--duplicate--LOGDIE-messages"></a>Suppressing &#39;duplicate&#39; LOGDIE messages</dt>
<dd>

<p>If a script with a simple Log4perl configuration uses logdie() to catch errors and stop processing, as in</p>

<pre><code>    use Log::Log4perl qw(:easy) ;
    Log::Log4perl-&gt;easy_init($DEBUG);
    
    shaky_function() or LOGDIE &quot;It failed!&quot;;</code></pre>

<p>there&#39;s a cosmetic problem: The message gets printed twice:</p>

<pre><code>    2005/07/10 18:37:14 It failed!
    It failed! at ./t line 12</code></pre>

<p>The obvious solution is to use LOGEXIT() instead of LOGDIE(), but there&#39;s also a special tag for Log4perl that suppresses the second message:</p>

<pre><code>    use Log::Log4perl qw(:no_extra_logdie_message);</code></pre>

<p>This causes logdie() and logcroak() to call exit() instead of die(). To modify the script exit code in these occasions, set the variable <code>$Log::Log4perl::LOGEXIT_CODE</code> to the desired value, the default is 1.</p>

</dd>
<dt id="Redefine-values-without-causing-errors"><a id="Redefine"></a>Redefine values without causing errors</dt>
<dd>

<p>Log4perl&#39;s configuration file parser has a few basic safety mechanisms to make sure configurations are more or less sane.</p>

<p>One of these safety measures is catching redefined values. For example, if you first write</p>

<pre><code>    log4perl.category = WARN, Logfile</code></pre>

<p>and then a couple of lines later</p>

<pre><code>    log4perl.category = TRACE, Logfile</code></pre>

<p>then you might have unintentionally overwritten the first value and Log4perl will die on this with an error (suspicious configurations always throw an error). Now, there&#39;s a chance that this is intentional, for example when you&#39;re lumping together several configuration files and actually <i>want</i> the first value to overwrite the second. In this case use</p>

<pre><code>    use Log::Log4perl qw(:nostrict);</code></pre>

<p>to put Log4perl in a more permissive mode.</p>

</dd>
<dt id="Prevent-croak/confess-from-stringifying"><a id="Prevent"></a><a id="Prevent-croak-confess-from-stringifying"></a>Prevent croak/confess from stringifying</dt>
<dd>

<p>The logcroak/logconfess functions stringify their arguments before they pass them to Carp&#39;s croak/confess functions. This can get in the way if you want to throw an object or a hashref as an exception, in this case use:</p>

<pre><code>    $Log::Log4perl::STRINGIFY_DIE_MESSAGE = 0;

    eval {
          # throws { foo =&gt; &quot;bar&quot; }
          # without stringification
        $logger-&gt;logcroak( { foo =&gt; &quot;bar&quot; } );
    };</code></pre>

</dd>
</dl>

<h1 id="EXAMPLE">EXAMPLE</h1>

<p>A simple example to cut-and-paste and get started:</p>

<pre><code>    use Log::Log4perl qw(get_logger);
    
    my $conf = q(
    log4perl.category.Bar.Twix         = WARN, Logfile
    log4perl.appender.Logfile          = Log::Log4perl::Appender::File
    log4perl.appender.Logfile.filename = test.log
    log4perl.appender.Logfile.layout = \
        Log::Log4perl::Layout::PatternLayout
    log4perl.appender.Logfile.layout.ConversionPattern = %d %F{1} %L&gt; %m %n
    );
    
    Log::Log4perl::init(\$conf);
    
    my $logger = get_logger(&quot;Bar::Twix&quot;);
    $logger-&gt;error(&quot;Blah&quot;);</code></pre>

<p>This will log something like</p>

<pre><code>    2002/09/19 23:48:15 t1 25&gt; Blah </code></pre>

<p>to the log file <code>test.log</code>, which Log4perl will append to or create it if it doesn&#39;t exist already.</p>

<h1 id="INSTALLATION">INSTALLATION</h1>

<p>If you want to use external appenders provided with <code>Log::Dispatch</code>, you need to install <code>Log::Dispatch</code> (2.00 or better) from CPAN, which itself depends on <code>Attribute-Handlers</code> and <code>Params-Validate</code>. And a lot of other modules, that&#39;s the reason why we&#39;re now shipping Log::Log4perl with its own standard appenders and only if you wish to use additional ones, you&#39;ll have to go through the <code>Log::Dispatch</code> installation process.</p>

<p>Log::Log4perl needs <code>Test::More</code>, <code>Test::Harness</code> and <code>File::Spec</code>, but they already come with fairly recent versions of perl. If not, everything&#39;s automatically fetched from CPAN if you&#39;re using the CPAN shell (CPAN.pm), because they&#39;re listed as dependencies.</p>

<p><code>Time::HiRes</code> (1.20 or better) is required only if you need the fine-grained time stamps of the <code>%r</code> parameter in <code>Log::Log4perl::Layout::PatternLayout</code>.</p>

<p>Manual installation works as usual with</p>

<pre><code>    perl Makefile.PL
    make
    make test
    make install</code></pre>

<h1 id="DEVELOPMENT">DEVELOPMENT</h1>

<p>Log::Log4perl is still being actively developed. We will always make sure the test suite (approx. 500 cases) will pass, but there might still be bugs. please check <a href="http://github.com/mschilli/log4perl">http://github.com/mschilli/log4perl</a> for the latest release. The api has reached a mature state, we will not change it unless for a good reason.</p>

<p>Bug reports and feedback are always welcome, just email them to our mailing list shown in the AUTHORS section. We&#39;re usually addressing them immediately.</p>

<h1 id="REFERENCES">REFERENCES</h1>

<dl>

<dt id="[1]"><a id="pod"></a>[1]</dt>
<dd>

<p>Michael Schilli, &quot;Retire your debugger, log smartly with Log::Log4perl!&quot;, Tutorial on perl.com, 09/2002, <a href="http://www.perl.com/pub/a/2002/09/11/log4perl.html">http://www.perl.com/pub/a/2002/09/11/log4perl.html</a></p>

</dd>
<dt id="[2]"><a id="pod1"></a>[2]</dt>
<dd>

<p>Ceki G&uuml;lc&uuml;, &quot;Short introduction to log4j&quot;, <a href="http://logging.apache.org/log4j/1.2/manual.html">http://logging.apache.org/log4j/1.2/manual.html</a></p>

</dd>
<dt id="[3]"><a id="pod2"></a>[3]</dt>
<dd>

<p>Vipan Singla, &quot;Don&#39;t Use System.out.println! Use Log4j.&quot;, <a href="http://www.vipan.com/htdocs/log4jhelp.html">http://www.vipan.com/htdocs/log4jhelp.html</a></p>

</dd>
<dt id="[4]"><a id="pod3"></a>[4]</dt>
<dd>

<p>The Log::Log4perl project home page: <a href="http://log4perl.com">http://log4perl.com</a></p>

</dd>
</dl>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<p><a href="https://metacpan.org/pod/Log::Log4perl::Config">Log::Log4perl::Config</a>, <a href="https://metacpan.org/pod/Log::Log4perl::Appender">Log::Log4perl::Appender</a>, <a href="https://metacpan.org/pod/Log::Log4perl::Layout::PatternLayout">Log::Log4perl::Layout::PatternLayout</a>, <a href="https://metacpan.org/pod/Log::Log4perl::Layout::SimpleLayout">Log::Log4perl::Layout::SimpleLayout</a>, <a href="https://metacpan.org/pod/Log::Log4perl::Level">Log::Log4perl::Level</a>, <a href="https://metacpan.org/pod/Log::Log4perl::JavaMap">Log::Log4perl::JavaMap</a> <a href="https://metacpan.org/pod/Log::Log4perl::NDC">Log::Log4perl::NDC</a>,</p>

<h1 id="AUTHORS">AUTHORS</h1>

<p>Please contribute patches to the project on Github:</p>

<pre><code>    http://github.com/mschilli/log4perl</code></pre>

<p>Send bug reports or requests for enhancements to the authors via our</p>

<p>MAILING LIST (questions, bug reports, suggestions/patches): log4perl-devel@lists.sourceforge.net</p>

<p>Authors (please contact them via the list above, not directly): Mike Schilli &lt;m@perlmeister.com&gt;, Kevin Goess &lt;cpan@goess.org&gt;</p>

<p>Contributors (in alphabetical order): Ateeq Altaf, Cory Bennett, Jens Berthold, Jeremy Bopp, Hutton Davidson, Chris R. Donnelly, Matisse Enzer, Hugh Esco, Anthony Foiani, James FitzGibbon, Carl Franks, Dennis Gregorovic, Andy Grundman, Paul Harrington, Alexander Hartmaier, David Hull, Robert Jacobson, Jason Kohles, Jeff Macdonald, Markus Peter, Brett Rann, Peter Rabbitson, Erik Selberg, Aaron Straup Cope, Lars Thegler, David Viner, Mac Yang.</p>

<h1 id="LICENSE">LICENSE</h1>

<p>Copyright 2002-2013 by Mike Schilli &lt;m@perlmeister.com&gt; and Kevin Goess &lt;cpan@goess.org&gt;.</p>

<p>This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install Log::Log4perl, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm Log::Log4perl</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install Log::Log4perl</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./Log::Log4perl.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
